perf use system libtraceevent
Ian Rogers
reviewerv2 cover perf use system libtraceevent
Detect whether libtraceevent is installed and if so build against it. If not installed, warn and build a subset of perf that works without libtraceevent. With nothing using the now out-of-date tools/lib/traceevent remove it.
Discussed on LKML here:
https://lore.kernel.org/lkml/CAP-5=fWxAjEia-Qbm0RVzKOxyiod8rUOBieqaGK=DtQboDe3Qw@mail.gmail.com/
Builds upon:
https://lore.kernel.org/lkml/[email protected]/
Based on discussion of the v1 patch set:
https://lore.kernel.org/lkml/[email protected]/
v2 conditionally compiles a subset of perf that doesn't require libtraceevent to avoid having to have libtraceevent installed on a system.
The changes build upon the fix in:
https://lore.kernel.org/lkml/[email protected]/
Ian Rogers (4):
perf util: Make header guard consistent with tool perf util: Add host_is_bigendian to util.h perf build: Use libtraceevent from the system tools lib traceevent: Remove libtraceevent
tools/lib/traceevent/.gitignore | 4 - tools/lib/traceevent/Build | 8 - tools/lib/traceevent/Documentation/Makefile | 207 - .../traceevent/Documentation/asciidoc.conf | 120 - .../Documentation/libtraceevent-commands.txt | 153 - .../Documentation/libtraceevent-cpus.txt | 77 - .../libtraceevent-endian_read.txt | 78 - .../libtraceevent-event_find.txt | 103 - .../Documentation/libtraceevent-event_get.txt | 99 - .../libtraceevent-event_list.txt | 122 - .../libtraceevent-event_print.txt | 130 - .../libtraceevent-field_find.txt | 118 - .../libtraceevent-field_get_val.txt | 122 - .../libtraceevent-field_print.txt | 126 - .../libtraceevent-field_read.txt | 81 - .../Documentation/libtraceevent-fields.txt | 105 - .../libtraceevent-file_endian.txt | 91 - .../Documentation/libtraceevent-filter.txt | 209 - .../Documentation/libtraceevent-func_apis.txt | 183 - .../Documentation/libtraceevent-func_find.txt | 88 - .../Documentation/libtraceevent-handle.txt | 101 - .../libtraceevent-header_page.txt | 102 - .../libtraceevent-host_endian.txt | 104 - .../Documentation/libtraceevent-long_size.txt | 78 - .../Documentation/libtraceevent-page_size.txt | 82 - .../libtraceevent-parse_event.txt | 90 - .../libtraceevent-parse_head.txt | 82 - .../Documentation/libtraceevent-plugins.txt | 122 - .../libtraceevent-record_parse.txt | 137 - .../libtraceevent-reg_event_handler.txt | 156 - .../libtraceevent-reg_print_func.txt | 155 - .../Documentation/libtraceevent-set_flag.txt | 104 - .../Documentation/libtraceevent-strerror.txt | 85 - .../Documentation/libtraceevent-tseq.txt | 158 - .../Documentation/libtraceevent.txt | 192 - .../traceevent/Documentation/manpage-1.72.xsl | 14 - .../traceevent/Documentation/manpage-base.xsl | 35 - .../Documentation/manpage-bold-literal.xsl | 17 - .../Documentation/manpage-normal.xsl | 13 - .../Documentation/manpage-suppress-sp.xsl | 21 - tools/lib/traceevent/Makefile | 300 - tools/lib/traceevent/event-parse-api.c | 333 - tools/lib/traceevent/event-parse-local.h | 123 - tools/lib/traceevent/event-parse.c | 7624 ----------------- tools/lib/traceevent/event-parse.h | 750 -- tools/lib/traceevent/event-plugin.c | 711 -- tools/lib/traceevent/event-utils.h | 67 - tools/lib/traceevent/kbuffer-parse.c | 809 -- tools/lib/traceevent/kbuffer.h | 68 - .../lib/traceevent/libtraceevent.pc.template | 10 - tools/lib/traceevent/parse-filter.c | 2281 ----- tools/lib/traceevent/parse-utils.c | 71 - tools/lib/traceevent/plugins/Build | 12 - tools/lib/traceevent/plugins/Makefile | 225 - .../lib/traceevent/plugins/plugin_cfg80211.c | 43 - .../lib/traceevent/plugins/plugin_function.c | 282 - tools/lib/traceevent/plugins/plugin_futex.c | 123 - tools/lib/traceevent/plugins/plugin_hrtimer.c | 74 - tools/lib/traceevent/plugins/plugin_jbd2.c | 61 - tools/lib/traceevent/plugins/plugin_kmem.c | 80 - tools/lib/traceevent/plugins/plugin_kvm.c | 527 -- .../lib/traceevent/plugins/plugin_mac80211.c | 88 - .../traceevent/plugins/plugin_sched_switch.c | 146 - tools/lib/traceevent/plugins/plugin_scsi.c | 434 - tools/lib/traceevent/plugins/plugin_tlb.c | 66 - tools/lib/traceevent/plugins/plugin_xen.c | 138 - tools/lib/traceevent/tep_strerror.c | 53 - tools/lib/traceevent/trace-seq.c | 249 - tools/lib/traceevent/trace-seq.h | 55 - tools/perf/Build | 11 +- tools/perf/Makefile.config | 37 +- tools/perf/Makefile.perf | 99 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/x86/util/intel-pt.c | 4 + tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-inject.c | 8 + tools/perf/builtin-kmem.c | 1 + tools/perf/builtin-kvm.c | 12 +- tools/perf/builtin-kwork.c | 1 + tools/perf/builtin-record.c | 2 + tools/perf/builtin-report.c | 9 +- tools/perf/builtin-script.c | 19 +- tools/perf/builtin-timechart.c | 1 + tools/perf/builtin-trace.c | 5 +- tools/perf/builtin-version.c | 1 + tools/perf/perf.c | 24 +- .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/tests/Build | 12 +- tools/perf/tests/builtin-test.c | 6 + tools/perf/tests/code-reading.c | 4 +- tools/perf/tests/parse-events.c | 20 + tools/perf/tests/sample-parsing.c | 4 +- tools/perf/util/Build | 10 +- tools/perf/util/data-convert-bt.c | 5 +- tools/perf/util/data-convert-json.c | 9 +- tools/perf/util/evlist.c | 6 +- tools/perf/util/evlist.h | 4 + tools/perf/util/evsel.c | 16 +- tools/perf/util/evsel.h | 12 +- tools/perf/util/evsel_fprintf.c | 7 +- tools/perf/util/header.c | 19 + tools/perf/util/header.h | 2 + tools/perf/util/intel-pt.c | 7 +- tools/perf/util/parse-events.c | 15 + tools/perf/util/parse-events.h | 1 - tools/perf/util/python.c | 4 + tools/perf/util/scripting-engines/Build | 6 +- .../scripting-engines/trace-event-python.c | 1 + tools/perf/util/session.c | 2 + tools/perf/util/session.h | 2 + tools/perf/util/sort.c | 60 +- tools/perf/util/synthetic-events.c | 6 + tools/perf/util/trace-event-info.c | 14 +- tools/perf/util/trace-event-parse.c | 2 + tools/perf/util/trace-event-read.c | 4 +- tools/perf/util/trace-event-scripting.c | 1 + tools/perf/util/trace-event.c | 1 - tools/perf/util/trace-event.h | 13 +- tools/perf/util/util.h | 25 +- 119 files changed, 344 insertions(+), 20071 deletions(-) delete mode 100644 tools/lib/traceevent/.gitignore delete mode 100644 tools/lib/traceevent/Build delete mode 100644 tools/lib/traceevent/Documentation/Makefile delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl delete mode 100644 tools/lib/traceevent/Makefile delete mode 100644 tools/lib/traceevent/event-parse-api.c delete mode 100644 tools/lib/traceevent/event-parse-local.h delete mode 100644 tools/lib/traceevent/event-parse.c delete mode 100644 tools/lib/traceevent/event-parse.h delete mode 100644 tools/lib/traceevent/event-plugin.c delete mode 100644 tools/lib/traceevent/event-utils.h delete mode 100644 tools/lib/traceevent/kbuffer-parse.c delete mode 100644 tools/lib/traceevent/kbuffer.h delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template delete mode 100644 tools/lib/traceevent/parse-filter.c delete mode 100644 tools/lib/traceevent/parse-utils.c delete mode 100644 tools/lib/traceevent/plugins/Build delete mode 100644 tools/lib/traceevent/plugins/Makefile delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c delete mode 100644 tools/lib/traceevent/tep_strerror.c delete mode 100644 tools/lib/traceevent/trace-seq.c delete mode 100644 tools/lib/traceevent/trace-seq.h
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Ian Rogers
reviewerPATCH v2 1/4 perf util: Make header guard consistent with tool
Remove git reference by changing GIT_COMPAT_UTIL_H to __PERF_UTIL_H.
--- tools/perf/util/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/util.h +3 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef GIT_COMPAT_UTIL_H -#define GIT_COMPAT_UTIL_H +#ifndef __PERF_UTIL_H +#define __PERF_UTIL_H#define _BSD_SOURCE 1/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
@@ -94,4 +94,4 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,0 ; \ }) -#endif /* GIT_COMPAT_UTIL_H */ +#endif /* __PERF_UTIL_H */
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Re: [PATCH v2 1/4] perf util: Make header guard consistent with tool
Quoted 4 lines · Ian Rogers
Remove git reference by changing
GIT_COMPAT_UTIL_Hto__PERF_UTIL_H.Signed-off-by Ian Rogers <[email protected]>
Thanks,
Namhyung
Quoted 26 lines
--- tools/perf/util/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/perf/util/util.h +3
-4@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef GIT_COMPAT_UTIL_H -#define GIT_COMPAT_UTIL_H +#ifndef __PERF_UTIL_H +#define __PERF_UTIL_H#define _BSD_SOURCE 1/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ @@ -94,4 +94,4 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,0 ; \ }) -#endif /* GIT_COMPAT_UTIL_H */ +#endif /* __PERF_UTIL_H */ --2.38.1.584.g0f3c55d4c2-goog
Ian Rogers
reviewerPATCH v2 2/4 perf util: Add host_is_bigendian to util.h
In reply to Ian RogersAvoid libtraceevent dependency for tep_is_bigendian or trace-event.h dependency for bigendian. Add a new host_is_bigendian to util.h, using the compiler defined __BYTE_ORDER__ when available.
--- tools/perf/tests/code-reading.c | 4 ++-- tools/perf/tests/sample-parsing.c | 4 ++-- tools/perf/util/evsel.c | 5 +---- tools/perf/util/trace-event-info.c | 14 +++----------- tools/perf/util/trace-event-read.c | 3 ++- tools/perf/util/trace-event.h | 2 -- tools/perf/util/util.h | 19 +++++++++++++++++++ 7 files changed, 29 insertions(+), 22 deletions(-)
tools/perf/tests/code-reading.c +2 -2
@@ -16,7 +16,6 @@#include "dso.h" #include "env.h" #include "parse-events.h" -#include "trace-event.h" #include "evlist.h" #include "evsel.h" #include "thread_map.h"
@@ -28,6 +27,7 @@#include "util/mmap.h" #include "util/string2.h" #include "util/synthetic-events.h" +#include "util/util.h" #include "thread.h" #include "tests.h"
@@ -79,7 +79,7 @@ static size_t read_objdump_chunk(const char **line, unsigned char **buf,* see disassemble_bytes() at binutils/objdump.c for details * how objdump chooses display endian) */ -if (bytes_read >1 && !bigendian ()) { +if (bytes_read >1 && !host_is_bigendian ()) {unsigned char *chunk_end = chunk_start + bytes_read -1 ;unsigned char tmp;
tools/perf/tests/sample-parsing.c +2 -2
@@ -13,7 +13,7 @@#include "evsel.h" #include "debug.h" #include "util/synthetic-events.h" -#include "util/trace-event.h" +#include "util/util.h" #include "tests.h"
@@ -117,7 +117,7 @@ static bool samples_same(const struct perf_sample *s1,COMP (branch_stack->hw_idx);for (i =0 ; i < s1->branch_stack->nr; i++) {if (needs_swap) -return ((tep_is_bigendian ()) ? +return ((host_is_bigendian ()) ? (FLAG (s2).value ==BS_EXPECTED_BE ) : (FLAG (s2).value ==BS_EXPECTED_LE ));else
tools/perf/util/evsel.c +1 -4
@@ -2320,11 +2320,8 @@ u64 evsel__bitfield_swap_branch_flags(u64 value)* as it has variable bit-field sizes. Instead the * macro takes the bit-field position/size, * swaps it based on the host endianness. -* -* tep_is_bigendian() is used here instead of -* bigendian() to avoid python test fails. */ -if (tep_is_bigendian ()) { +if (host_is_bigendian ()) { new_val =bitfield_swap (value,0 ,1 ); new_val |=bitfield_swap (value,1 ,1 ); new_val |=bitfield_swap (value,2 ,1 );
tools/perf/util/trace-event-info.c +3 -11
@@ -26,6 +26,7 @@#include <api/fs/tracing_path.h> #include "evsel.h" #include "debug.h" +#include "util.h" #define VERSION "0.6"#define MAX_EVENT_LENGTH 512
@@ -38,15 +39,6 @@ struct tracepoint_path {struct tracepoint_path *next; }; -int bigendian (void ) -{ -unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 ,0x0 ,0x0 ,0x0 ,0x0 }; -unsigned int *ptr; - - ptr = (unsigned int *)(void *)str; -return *ptr ==0x01020304 ; -} -/* unfortunately, you can not stat debugfs or proc files for size */ static int record_file (const char *file,ssize_t hdr_sz) {
@@ -79,7 +71,7 @@ static int record_file(const char *file, ssize_t hdr_sz)/* ugh, handle big-endian hdr_size == 4 */ sizep = (char *)&size; -if (bigendian ()) +if (host_is_bigendian ()) sizep +=sizeof (u64) - hdr_sz;if (hdr_sz &&pwrite (output_fd, sizep, hdr_sz, hdr_pos) <0 ) {
@@ -564,7 +556,7 @@ static int tracing_data_header(void)return -1 ;/* save endian */ -if (bigendian ()) +if (host_is_bigendian ()) buf[0 ] =1 ;else buf[0 ] =0 ;
tools/perf/util/trace-event-read.c +2 -1
@@ -17,6 +17,7 @@#include "trace-event.h" #include "debug.h" +#include "util.h" static int input_fd;
@@ -414,7 +415,7 @@ ssize_t trace_report(int fd, struct trace_event *tevent, bool __repipe)return -1 ; } file_bigendian = buf[0 ]; - host_bigendian =bigendian (); + host_bigendian =host_is_bigendian () ?1 :0 ;if (trace_event__init (tevent)) {pr_debug ("trace_event__init failed" );
tools/perf/util/trace-event.h +0 -2
@@ -27,8 +27,6 @@ trace_event__tp_format(const char *sys, const char *name);struct tep_event *trace_event__tp_format_id (int id); -int bigendian (void ); -void event_format__fprintf (struct tep_event *event,int cpu,void *data,int size,FILE *fp);
tools/perf/util/util.h +19 -0
@@ -94,4 +94,23 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,0 ; \ }) +static inline bool host_is_bigendian (void ) +{ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +return false; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +return true; +#else +#error "Unrecognized __BYTE_ORDER__" +#endif +#else +unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 ,0x0 ,0x0 ,0x0 ,0x0 }; +unsigned int *ptr; + + ptr = (unsigned int *)(void *)str; +return *ptr ==0x01020304 ; +#endif +} +#endif /* __PERF_UTIL_H */
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Re: [PATCH v2 2/4] perf util: Add host_is_bigendian to util.h
Quoted 6 lines · Ian Rogers
Avoid libtraceevent dependency for
tep_is_bigendianortrace-event.hdependency for bigendian. Add a newhost_is_bigendiantoutil.h, using the compiler defined__BYTE_ORDER__when available.Signed-off-by Ian Rogers <[email protected]>
A nit below...
Quoted 1 line
---
[SNIP]
Quoted 9 lines
tools/perf/util/util.h +1
-0@@ -94,4 +94,23 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,0 ; \ }) +static inline bool host_is_bigendian (void )
tools/perf/util/util.h int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x, · line 107
Quoted 10 lines
tools/perf/util/util.h +10
-0+{ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +return false; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +return true; +#else +#error "Unrecognized __BYTE_ORDER__" +#endif +#else
It'd be nice if we could have a comment at least there's a nested ifdef condition. Like below?
#else /* !__BYTE_ORDER__ */
Thanks,
Namhyung
Quoted 12 lines
tools/perf/util/util.h +8
-1+unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 ,0x0 ,0x0 ,0x0 ,0x0 }; +unsigned int *ptr; + + ptr = (unsigned int *)(void *)str; +return *ptr ==0x01020304 ; +#endif +} +#endif /* __PERF_UTIL_H */ --2.38.1.584.g0f3c55d4c2-goog
Arnaldo Carvalho de Melo
maintainerRe: [PATCH v2 2/4] perf util: Add host_is_bigendian to util.h
Em Wed, Nov 30, 2022 at 10:52:35AM -0800, Namhyung Kim escreveu:
Quoted 37 lines · Ian Rogers
Quoted 6 lines
Avoid libtraceevent dependency for
tep_is_bigendianortrace-event.hdependency for bigendian. Add a newhost_is_bigendiantoutil.h, using the compiler defined__BYTE_ORDER__when available.Signed-off-by Ian Rogers <[email protected]>Acked-by Namhyung Kim <[email protected]>A nit below...
Quoted 1 line
---
[SNIP]
Quoted 9 lines
tools/perf/util/util.h +1
-0@@ -94,4 +94,23 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x,0 ; \ }) +static inline bool host_is_bigendian (void )tools/perf/util/util.h int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x, · line 107
Quoted 10 lines
tools/perf/util/util.h +10
-0+{ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +return false; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +return true; +#else +#error "Unrecognized __BYTE_ORDER__" +#endif +#else It'd be nice if we could have a comment at least there's a nested ifdef condition. Like below?
Quoted 1 line
#else /* !__BYTE_ORDER__ */
Reasonable, added it and applied the first two patches in this series, with your Acked-by, thanks.
- Arnaldo
tools/perf/util/util.h +1 -1
@@ -104,7 +104,7 @@ static inline bool host_is_bigendian(void)#else #error "Unrecognized __BYTE_ORDER__"#endif -#else +#else /* !__BYTE_ORDER__ */ unsigned char str[] = {0x1 ,0x2 ,0x3 ,0x4 ,0x0 ,0x0 ,0x0 ,0x0 };unsigned int *ptr;
Ian Rogers
reviewerPATCH v2 3/4 perf build: Use libtraceevent from the system
In reply to Ian RogersRemove the LIBTRACEEVENT_DYNAMIC and LIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disables CONFIG_TRACE that controls "perf
trace". CONFIG_TRACEEVENT is used to control enablement in Build/Makefiles, HAVE_LIBTRACEEVENT is used in C code. Without HAVE_LIBTRACEEVENT tracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".
--- tools/perf/Build | 11 ++- tools/perf/Makefile.config | 37 +++---- tools/perf/Makefile.perf | 99 +------------------ tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/x86/util/intel-pt.c | 4 + tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-inject.c | 8 ++ tools/perf/builtin-kmem.c | 1 + tools/perf/builtin-kvm.c | 12 +-- tools/perf/builtin-kwork.c | 1 + tools/perf/builtin-record.c | 2 + tools/perf/builtin-report.c | 9 +- tools/perf/builtin-script.c | 19 +++- tools/perf/builtin-timechart.c | 1 + tools/perf/builtin-trace.c | 5 +- tools/perf/builtin-version.c | 1 + tools/perf/perf.c | 24 +++-- .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/tests/Build | 12 +-- tools/perf/tests/builtin-test.c | 6 ++ tools/perf/tests/parse-events.c | 20 ++++ tools/perf/util/Build | 10 +- tools/perf/util/data-convert-bt.c | 5 +- tools/perf/util/data-convert-json.c | 9 +- tools/perf/util/evlist.c | 6 +- tools/perf/util/evlist.h | 4 + tools/perf/util/evsel.c | 11 ++- tools/perf/util/evsel.h | 12 ++- tools/perf/util/evsel_fprintf.c | 7 +- tools/perf/util/header.c | 19 ++++ tools/perf/util/header.h | 2 + tools/perf/util/intel-pt.c | 7 +- tools/perf/util/parse-events.c | 15 +++ tools/perf/util/parse-events.h | 1 - tools/perf/util/python.c | 4 + tools/perf/util/scripting-engines/Build | 6 +- .../scripting-engines/trace-event-python.c | 1 + tools/perf/util/session.c | 2 + tools/perf/util/session.h | 2 + tools/perf/util/sort.c | 60 +++++++++-- tools/perf/util/synthetic-events.c | 6 ++ tools/perf/util/trace-event-parse.c | 2 + tools/perf/util/trace-event-read.c | 1 + tools/perf/util/trace-event-scripting.c | 1 + tools/perf/util/trace-event.c | 1 - tools/perf/util/trace-event.h | 11 ++- 46 files changed, 312 insertions(+), 171 deletions(-)
tools/perf/Build +6 -5
@@ -5,7 +5,6 @@ perf-y += builtin-diff.o perf-y += builtin-evlist.o perf-y += builtin-ftrace.o perf-y += builtin-help.o -perf-y += builtin-sched.o perf-y += builtin-buildid-list.o perf-y += builtin-buildid-cache.o perf-y += builtin-kallsyms.o
@@ -13,11 +12,8 @@ perf-y += builtin-list.o perf-y += builtin-record.o perf-y += builtin-report.o perf-y += builtin-stat.o -perf-y += builtin-timechart.o perf-y += builtin-top.o perf-y += builtin-script.o -perf-y += builtin-kmem.o -perf-y += builtin-lock.o perf-y += builtin-kvm.o perf-y += builtin-inject.o perf-y += builtin-mem.o
@@ -25,7 +21,12 @@ perf-y += builtin-data.o perf-y += builtin-version.o perf-y += builtin-c2c.o perf-y += builtin-daemon.o -perf-y += builtin-kwork.o + +perf-$(CONFIG_TRACEEVENT) += builtin-kmem.o +perf-$(CONFIG_TRACEEVENT) += builtin-kwork.o +perf-$(CONFIG_TRACEEVENT) += builtin-lock.o +perf-$(CONFIG_TRACEEVENT) += builtin-sched.o +perf-$(CONFIG_TRACEEVENT) += builtin-timechart.o perf-$(CONFIG_TRACE) += builtin-trace.o perf-$(CONFIG_LIBELF) += builtin-probe.o
tools/perf/Makefile.config +19 -18
@@ -763,18 +763,20 @@ ifndef NO_LIBUNWIND EXTLIBS += $(EXTLIBS_LIBUNWIND) endif -ifeq ($(NO_SYSCALL_TABLE),0) - $(call detected,CONFIG_TRACE) -else - ifndef NO_LIBAUDIT - $(call feature_check,libaudit) - ifneq ($(feature-libaudit), 1) - msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); - NO_LIBAUDIT := 1 - else - CFLAGS += -DHAVE_LIBAUDIT_SUPPORT - EXTLIBS += -laudit - $(call detected,CONFIG_TRACE) +ifneq ($(NO_LIBTRACEEVENT),1) + ifeq ($(NO_SYSCALL_TABLE),0) + $(call detected,CONFIG_TRACE) + else + ifndef NO_LIBAUDIT + $(call feature_check,libaudit) + ifneq ($(feature-libaudit), 1) + msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); + NO_LIBAUDIT := 1 + else + CFLAGS += -DHAVE_LIBAUDIT_SUPPORT + EXTLIBS += -laudit + $(call detected,CONFIG_TRACE) + endif endif endif endif
@@ -1182,9 +1184,11 @@ ifdef LIBPFM4 endif endif -ifdef LIBTRACEEVENT_DYNAMIC +# libtraceevent is a recommended dependency picked up from the system. +ifneq ($(NO_LIBTRACEEVENT),1) $(call feature_check,libtraceevent) ifeq ($(feature-libtraceevent), 1) + CFLAGS += -DHAVE_LIBTRACEEVENT EXTLIBS += -ltraceevent LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent) LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
@@ -1192,12 +1196,11 @@ ifdef LIBTRACEEVENT_DYNAMIC LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION))) LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3)) CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP) + $(call detected,CONFIG_TRACEEVENT) else - dummy := $(error Error: No libtraceevent devel library found, please install libtraceevent-devel); + dummy := $(warning Warning: libtraceevent is missing limiting functionality, please install libtraceevent-dev) endif -endif -ifdef LIBTRACEFS_DYNAMIC $(call feature_check,libtracefs) ifeq ($(feature-libtracefs), 1) EXTLIBS += -ltracefs
@@ -1207,8 +1210,6 @@ ifdef LIBTRACEFS_DYNAMIC LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION))) LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3)) CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP) - else - dummy := $(error Error: No libtracefs devel library found, please install libtracefs-dev); endif endif
tools/perf/Makefile.perf +5 -94
178 lines not on this page · raw message
tools/perf/arch/x86/util/Build +1 -1
@@ -1,7 +1,7 @@ perf-y += header.o perf-y += tsc.o perf-y += pmu.o -perf-y += kvm-stat.o +perf-$(CONFIG_TRACEEVENT) += kvm-stat.o perf-y += perf_regs.o perf-y += topdown.o perf-y += machine.o
tools/perf/arch/x86/util/intel-pt.c +4 -0
@@ -418,6 +418,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,return 0 ; } +#ifdef HAVE_LIBTRACEEVENT static int intel_pt_track_switches (struct evlist *evlist) {const char *sched_switch ="sched:sched_switch" ;
@@ -439,6 +440,7 @@ static int intel_pt_track_switches(struct evlist *evlist) return 0; } +#endif static void intel_pt_valid_str (char *str,size_t len,u64 valid) {
@@ -829,6 +831,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, ptr->have_sched_switch =2 ; } }else { +#ifdef HAVE_LIBTRACEEVENT err =intel_pt_track_switches (evlist);if (err == -EPERM )pr_debug2 ("Unable to select sched:sched_switch\n" );
@@ -836,6 +839,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,return err; else ptr->have_sched_switch = 1; +#endif } }
tools/perf/builtin-annotate.c +2 -0
@@ -499,7 +499,9 @@ int cmd_annotate(int argc, const char **argv) .namespaces = perf_event__process_namespaces, .attr = perf_event__process_attr, .build_id = perf_event__process_build_id, +#ifdef HAVE_LIBTRACEEVENT .tracing_data = perf_event__process_tracing_data, +#endif .id_index = perf_event__process_id_index, .auxtrace_info = perf_event__process_auxtrace_info, .auxtrace = perf_event__process_auxtrace,
tools/perf/builtin-inject.c +8 -0
@@ -607,6 +607,7 @@ static int perf_event__repipe_exit(struct perf_tool *tool,return err; } +#ifdef HAVE_LIBTRACEEVENT static int perf_event__repipe_tracing_data (struct perf_session *session,union perf_event *event) {
@@ -614,6 +615,7 @@ static int perf_event__repipe_tracing_data(struct perf_session *session, return perf_event__process_tracing_data(session, event); } +#endif static int dso__read_build_id (struct dso *dso) {
@@ -807,6 +809,7 @@ static int perf_inject__sched_switch(struct perf_tool *tool,return 0 ; } +#ifdef HAVE_LIBTRACEEVENT static int perf_inject__sched_stat(struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample,
@@ -836,6 +839,7 @@ static int perf_inject__sched_stat(struct perf_tool *tool,build_id__mark_dso_hit (tool, event_sw, &sample_sw, evsel, machine); return perf_event__repipe(tool, event_sw, &sample_sw, machine); } +#endif static struct guest_vcpu *guest_session__vcpu (struct guest_session *gs,u32 vcpu) {
@@ -1961,7 +1965,9 @@ static int __cmd_inject(struct perf_inject *inject) inject->tool.mmap = perf_event__repipe_mmap; inject->tool.mmap2 = perf_event__repipe_mmap2; inject->tool.fork = perf_event__repipe_fork; +#ifdef HAVE_LIBTRACEEVENT inject->tool.tracing_data = perf_event__repipe_tracing_data; +#endif } output_data_offset =perf_session__data_offset (session->evlist);
@@ -1984,8 +1990,10 @@ static int __cmd_inject(struct perf_inject *inject) evsel->handler = perf_inject__sched_switch; }else if (!strcmp (name,"sched:sched_process_exit" )) evsel->handler = perf_inject__sched_process_exit; +#ifdef HAVE_LIBTRACEEVENT else if (!strncmp(name, "sched:sched_stat_", 17)) evsel->handler = perf_inject__sched_stat; +#endif } }else if (inject->itrace_synth_opts.vm_time_correlation) { session->itrace_synth_opts = &inject->itrace_synth_opts;
tools/perf/builtin-kmem.c +1 -0
@@ -35,6 +35,7 @@#include <regex.h> #include <linux/ctype.h> +#include <traceevent/event-parse.h> static int kmem_slab;static int kmem_page;
tools/perf/builtin-kvm.c +6 -6
@@ -63,7 +63,7 @@ static const char *get_filename_for_perf_kvm(void)return filename; } -#ifdef HAVE_KVM_STAT_SUPPORT +#if defined(HAVE_KVM_STAT_SUPPORT ) && defined(HAVE_LIBTRACEEVENT ) void exit_event_get_key(struct evsel *evsel, struct perf_sample *sample,
@@ -654,7 +654,7 @@ static void print_result(struct perf_kvm_stat *kvm)pr_info ("\nLost events: %" PRIu64"\n\n" , kvm->lost_events); } -#ifdef HAVE_TIMERFD_SUPPORT +#if defined(HAVE_TIMERFD_SUPPORT ) && defined(HAVE_LIBTRACEEVENT ) static int process_lost_event(struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample __maybe_unused,
@@ -742,7 +742,7 @@ static bool verify_vcpu(int vcpu)return true; } -#ifdef HAVE_TIMERFD_SUPPORT +#if defined(HAVE_TIMERFD_SUPPORT ) && defined(HAVE_LIBTRACEEVENT )/* keeping the max events to a modest level to keep * the processing of samples per mmap smooth. */
@@ -1290,7 +1290,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)return kvm_events_report_vcpu (kvm); } -#ifdef HAVE_TIMERFD_SUPPORT +#if defined(HAVE_TIMERFD_SUPPORT ) && defined(HAVE_LIBTRACEEVENT )static struct evlist *kvm_live_event_list (void ) {struct evlist *evlist;
@@ -1507,7 +1507,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)if (strlen (argv[1 ]) >2 &&strstarts ("report" , argv[1 ]))return kvm_events_report (&kvm, argc -1 , argv +1 ); -#ifdef HAVE_TIMERFD_SUPPORT +#if defined(HAVE_TIMERFD_SUPPORT ) && defined(HAVE_LIBTRACEEVENT )if (!strncmp (argv[1 ],"live" ,4 ))return kvm_events_live (&kvm, argc -1 , argv +1 );#endif
@@ -1644,7 +1644,7 @@ int cmd_kvm(int argc, const char **argv)return cmd_top (argc, argv); else if (strlen(argv[0]) > 2 && strstarts("buildid-list", argv[0]))return __cmd_buildid_list (file_name, argc, argv); -#ifdef HAVE_KVM_STAT_SUPPORT +#if defined(HAVE_KVM_STAT_SUPPORT ) && defined(HAVE_LIBTRACEEVENT ) else if (strlen(argv[0]) > 2 && strstarts("stat", argv[0]))return kvm_cmd_stat (file_name, argc, argv);#endif
tools/perf/builtin-kwork.c +1 -0
@@ -23,6 +23,7 @@#include <subcmd/pager.h> #include <subcmd/parse-options.h> +#include <traceevent/event-parse.h> #include <errno.h> #include <inttypes.h>
tools/perf/builtin-record.c +2 -0
@@ -1701,8 +1701,10 @@ static void record__init_features(struct record *rec)if (rec->no_buildid)perf_header__clear_feat (&session->header,HEADER_BUILD_ID ); +#ifdef HAVE_LIBTRACEEVENT if (!have_tracepoints (&rec->evlist->core.entries))perf_header__clear_feat (&session->header,HEADER_TRACING_DATA ); +#endif if (!rec->opts.branch_stack)perf_header__clear_feat (&session->header,HEADER_BRANCH_STACK );
tools/perf/builtin-report.c +8 -1
@@ -67,6 +67,10 @@#include <unistd.h> #include <linux/mman.h> +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +struct report {struct perf_tool tool;struct perf_session *session;
@@ -1199,7 +1203,9 @@ int cmd_report(int argc, const char **argv) .lost = perf_event__process_lost, .read = process_read_event, .attr = process_attr, +#ifdef HAVE_LIBTRACEEVENT .tracing_data = perf_event__process_tracing_data, +#endif .build_id = perf_event__process_build_id, .id_index = perf_event__process_id_index, .auxtrace_info = perf_event__process_auxtrace_info,
@@ -1660,6 +1666,7 @@ int cmd_report(int argc, const char **argv) report.range_num); } +#ifdef HAVE_LIBTRACEEVENT if (session->tevent.pevent && tep_set_function_resolver(session->tevent.pevent, machine__resolve_kernel_addr,
@@ -1668,7 +1675,7 @@ int cmd_report(int argc, const char **argv) __func__); return -1; } - +#endif sort__setup_elide (stdout); ret =__cmd_report (&report);
tools/perf/builtin-script.c +15 -4
@@ -62,6 +62,9 @@#include "perf.h" #include <linux/ctype.h> +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif static char const *script_name;static char const *generate_script_lang;
@@ -2154,12 +2157,12 @@ static void process_event(struct perf_script *script,perf_sample__fprintf_bts (sample, evsel, thread, al, addr_al, machine, fp);return ; } - +#ifdef HAVE_LIBTRACEEVENT if (PRINT_FIELD (TRACE ) && sample->raw_data) {event_format__fprintf (evsel->tp_format, sample->cpu, sample->raw_data, sample->raw_size, fp); } - +#endif if (attr->type ==PERF_TYPE_SYNTH &&PRINT_FIELD (SYNTH ))perf_sample__fprintf_synth (sample, evsel, fp);
@@ -2283,8 +2286,10 @@ static void process_stat_interval(u64 tstamp)static void setup_scripting (void ) { +#ifdef HAVE_LIBTRACEEVENT setup_perl_scripting ();setup_python_scripting (); +#endif }static int flush_scripting (void )
@@ -3784,7 +3789,9 @@ int cmd_script(int argc, const char **argv) .fork = perf_event__process_fork, .attr = process_attr, .event_update = perf_event__process_event_update, +#ifdef HAVE_LIBTRACEEVENT .tracing_data = perf_event__process_tracing_data, +#endif .feature = process_feature_event, .build_id = perf_event__process_build_id, .id_index = perf_event__process_id_index,
@@ -4215,6 +4222,7 @@ int cmd_script(int argc, const char **argv)else symbol_conf.use_callchain = false; +#ifdef HAVE_LIBTRACEEVENT if (session->tevent.pevent && tep_set_function_resolver(session->tevent.pevent, machine__resolve_kernel_addr,
@@ -4223,7 +4231,7 @@ int cmd_script(int argc, const char **argv) err =-1 ; goto out_delete; } - +#endif if (generate_script_lang) {struct stat perf_stat;int input;
@@ -4259,9 +4267,12 @@ int cmd_script(int argc, const char **argv) err = -ENOENT ; goto out_delete; } - +#ifdef HAVE_LIBTRACEEVENT err = scripting_ops->generate_script (session->tevent.pevent,"perf-script" ); +#else + err = scripting_ops->generate_script (NULL ,"perf-script" ); +#endif goto out_delete; }
tools/perf/builtin-timechart.c +1 -0
@@ -38,6 +38,7 @@#include "util/string2.h" #include "util/tracepoint.h" #include <linux/err.h> +#include <traceevent/event-parse.h> #ifdef LACKS_OPEN_MEMSTREAM_PROTOTYPE FILE *open_memstream (char **ptr,size_t *sizeloc);
tools/perf/builtin-trace.c +4 -1
@@ -15,7 +15,6 @@*/ #include "util/record.h" -#include <traceevent/event-parse.h> #include <api/fs/tracing_path.h> #include <bpf/bpf.h> #include "util/bpf_map.h"
@@ -80,6 +79,10 @@#include <linux/ctype.h> #include <perf/mmap.h> +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +#ifndef O_CLOEXEC # define O_CLOEXEC 02000000#endif
tools/perf/builtin-version.c +1 -0
@@ -82,6 +82,7 @@ static void library_status(void)STATUS (HAVE_AIO_SUPPORT , aio);STATUS (HAVE_ZSTD_SUPPORT , zstd);STATUS (HAVE_LIBPFM , libpfm4); +STATUS (HAVE_LIBTRACEEVENT , libtraceevent); }int cmd_version (int argc,const char **argv)
tools/perf/perf.c +18 -6
@@ -70,20 +70,26 @@ static struct cmd_struct commands[] = { { "report", cmd_report, 0 }, { "bench", cmd_bench, 0 }, { "stat", cmd_stat, 0 }, +#ifdef HAVE_LIBTRACEEVENT { "timechart", cmd_timechart, 0 }, +#endif { "top", cmd_top, 0 }, { "annotate", cmd_annotate, 0 }, { "version", cmd_version, 0 }, { "script", cmd_script, 0 }, +#ifdef HAVE_LIBTRACEEVENT { "sched", cmd_sched, 0 }, +#endif #ifdef HAVE_LIBELF_SUPPORT { "probe", cmd_probe, 0 }, #endif +#ifdef HAVE_LIBTRACEEVENT { "kmem", cmd_kmem, 0 }, { "lock", cmd_lock, 0 }, +#endif { "kvm", cmd_kvm, 0 }, { "test", cmd_test, 0 }, -#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT) +#if defined(HAVE_LIBTRACEEVENT) && (defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)) { "trace", cmd_trace, 0 }, #endif { "inject", cmd_inject, 0 },
@@ -91,7 +97,9 @@ static struct cmd_struct commands[] = { { "data", cmd_data, 0 }, { "ftrace", cmd_ftrace, 0 }, { "daemon", cmd_daemon, 0 }, +#ifdef HAVE_LIBTRACEEVENT { "kwork", cmd_kwork, 0 }, +#endif }; struct pager_config {
@@ -500,14 +508,18 @@ int main(int argc, const char **argv) argv[0 ] = cmd; }if (strstarts (cmd,"trace" )) { -#if defined(HAVE_LIBAUDIT_SUPPORT ) || defined(HAVE_SYSCALL_TABLE_SUPPORT ) -setup_path (); - argv[0 ] ="trace" ; -return cmd_trace (argc, argv); -#else +#ifndef HAVE_LIBTRACEEVENT +fprintf (stderr, +"trace command not available: missing libtraceevent devel package at build time.\n" ); + goto out; +#elif !defined(HAVE_LIBAUDIT_SUPPORT ) && !defined(HAVE_SYSCALL_TABLE_SUPPORT )fprintf (stderr,"trace command not available: missing audit-libs devel package at build time.\n" ); goto out; +#else +setup_path (); + argv[0 ] ="trace" ; +return cmd_trace (argc, argv);#endif }/* Look for flags.. */
tools/perf/scripts/python/Perf-Trace-Util/Build +1 -1
@@ -1,3 +1,3 @@ -perf-y += Context.o +perf-$(CONFIG_TRACEEVENT) += Context.o CFLAGS_Context.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
tools/perf/tests/Build +6 -6
@@ -6,13 +6,13 @@ perf-y += parse-events.o perf-y += dso-data.o perf-y += attr.o perf-y += vmlinux-kallsyms.o -perf-y += openat-syscall.o -perf-y += openat-syscall-all-cpus.o -perf-y += openat-syscall-tp-fields.o -perf-y += mmap-basic.o +perf-$(CONFIG_TRACEEVENT) += openat-syscall.o +perf-$(CONFIG_TRACEEVENT) += openat-syscall-all-cpus.o +perf-$(CONFIG_TRACEEVENT) += openat-syscall-tp-fields.o +perf-$(CONFIG_TRACEEVENT) += mmap-basic.o perf-y += perf-record.o perf-y += evsel-roundtrip-name.o -perf-y += evsel-tp-sched.o +perf-$(CONFIG_TRACEEVENT) += evsel-tp-sched.o perf-y += fdarray.o perf-y += pmu.o perf-y += pmu-events.o
@@ -30,7 +30,7 @@ perf-y += task-exit.o perf-y += sw-clock.o perf-y += mmap-thread-lookup.o perf-y += thread-maps-share.o -perf-y += switch-tracking.o +perf-$(CONFIG_TRACEEVENT) += switch-tracking.o perf-y += keep-tracking.o perf-y += code-reading.o perf-y += sample-parsing.o
tools/perf/tests/builtin-test.c +6 -0
@@ -38,9 +38,11 @@ struct test_suite *__weak arch_tests[] = {static struct test_suite *generic_tests[] = { &suite__vmlinux_matches_kallsyms, +#ifdef HAVE_LIBTRACEEVENT &suite__openat_syscall_event, &suite__openat_syscall_event_on_all_cpus, &suite__basic_mmap, +#endif &suite__mem, &suite__parse_events, &suite__expr,
@@ -51,8 +53,10 @@ static struct test_suite *generic_tests[] = { &suite__dso_data_cache, &suite__dso_data_reopen, &suite__perf_evsel__roundtrip_name_test, +#ifdef HAVE_LIBTRACEEVENT &suite__perf_evsel__tp_sched_test, &suite__syscall_openat_tp_fields, +#endif &suite__attr, &suite__hists_link, &suite__python_use,
@@ -71,7 +75,9 @@ static struct test_suite *generic_tests[] = { &suite__thread_maps_share, &suite__hists_output, &suite__hists_cumulate, +#ifdef HAVE_LIBTRACEEVENT &suite__switch_tracking, +#endif &suite__fdarray__filter, &suite__fdarray__add, &suite__kmod_path__parse,
tools/perf/tests/parse-events.c +20 -0
@@ -46,6 +46,7 @@ static bool kvm_s390_create_vm_valid(void) }#endif +#ifdef HAVE_LIBTRACEEVENT static int test__checkevent_tracepoint (struct evlist *evlist) {struct evsel *evsel =evlist__first (evlist);
@@ -76,6 +77,7 @@ static int test__checkevent_tracepoint_multi(struct evlist *evlist) }return TEST_OK ; } +#endif /* HAVE_LIBTRACEEVENT */ static int test__checkevent_raw (struct evlist *evlist) {
@@ -222,6 +224,7 @@ static int test__checkevent_breakpoint_rw(struct evlist *evlist)return TEST_OK ; } +#ifdef HAVE_LIBTRACEEVENT static int test__checkevent_tracepoint_modifier (struct evlist *evlist) {struct evsel *evsel =evlist__first (evlist);
@@ -252,6 +255,7 @@ test__checkevent_tracepoint_multi_modifier(struct evlist *evlist) return test__checkevent_tracepoint_multi(evlist); } +#endif /* HAVE_LIBTRACEEVENT */ static int test__checkevent_raw_modifier (struct evlist *evlist) {
@@ -453,6 +457,7 @@ static int test__checkevent_pmu(struct evlist *evlist)return TEST_OK ; } +#ifdef HAVE_LIBTRACEEVENT static int test__checkevent_list (struct evlist *evlist) {struct evsel *evsel =evlist__first (evlist);
@@ -491,6 +496,7 @@ static int test__checkevent_list(struct evlist *evlist) return TEST_OK; } +#endif static int test__checkevent_pmu_name (struct evlist *evlist) {
@@ -762,6 +768,7 @@ static int test__group2(struct evlist *evlist)return TEST_OK ; } +#ifdef HAVE_LIBTRACEEVENT static int test__group3 (struct evlist *evlist__maybe_unused ) {struct evsel *evsel, *leader;
@@ -853,6 +860,7 @@ static int test__group3(struct evlist *evlist __maybe_unused) return TEST_OK; } +#endif static int test__group4 (struct evlist *evlist__maybe_unused ) {
@@ -1460,6 +1468,7 @@ static int test__sym_event_dc(struct evlist *evlist)return TEST_OK ; } +#ifdef HAVE_LIBTRACEEVENT static int count_tracepoints (void ) {struct dirent *events_ent;
@@ -1513,6 +1522,7 @@ static int test__all_tracepoints(struct evlist *evlist) return test__checkevent_tracepoint_multi(evlist); } +#endif /* HAVE_LIBTRACEVENT */ static int test__hybrid_hw_event_with_pmu (struct evlist *evlist) {
@@ -1642,6 +1652,7 @@ struct evlist_test { };static const struct evlist_test test__events[] = { +#ifdef HAVE_LIBTRACEEVENT { .name ="syscalls:sys_enter_openat" , .check = test__checkevent_tracepoint,
@@ -1652,6 +1663,7 @@ static const struct evlist_test test__events[] = { .check = test__checkevent_tracepoint_multi, /* 1 */ }, +#endif { .name = "r1a", .check = test__checkevent_raw,
@@ -1702,6 +1714,7 @@ static const struct evlist_test test__events[] = { .check = test__checkevent_breakpoint_w, /* 1 */ }, +#ifdef HAVE_LIBTRACEEVENT { .name = "syscalls:sys_enter_openat:k", .check = test__checkevent_tracepoint_modifier,
@@ -1712,6 +1725,7 @@ static const struct evlist_test test__events[] = { .check = test__checkevent_tracepoint_multi_modifier, /* 3 */ }, +#endif { .name = "r1a:kp", .check = test__checkevent_raw_modifier,
@@ -1757,11 +1771,13 @@ static const struct evlist_test test__events[] = { .check = test__checkevent_breakpoint_w_modifier, /* 2 */ }, +#ifdef HAVE_LIBTRACEEVENT { .name = "r1,syscalls:sys_enter_openat:k,1:1:hp", .check = test__checkevent_list, /* 3 */ }, +#endif { .name = "instructions:G", .check = test__checkevent_exclude_host_modifier,
@@ -1792,11 +1808,13 @@ static const struct evlist_test test__events[] = { .check = test__group2, /* 9 */ }, +#ifdef HAVE_LIBTRACEEVENT { .name = "group1{syscalls:sys_enter_openat:H,cycles:kppp},group2{cycles,1:3}:G,instructions:u", .check = test__group3, /* 0 */ }, +#endif { .name = "{cycles:u,instructions:kp}:p", .check = test__group4,
@@ -1807,11 +1825,13 @@ static const struct evlist_test test__events[] = { .check = test__group5, /* 2 */ }, +#ifdef HAVE_LIBTRACEEVENT { .name = "*:*", .check = test__all_tracepoints, /* 3 */ }, +#endif { .name = "{cycles,cache-misses:G}:H", .check = test__group_gh1,
tools/perf/util/Build +5 -5
@@ -69,17 +69,17 @@ perf-y += namespaces.o perf-y += comm.o perf-y += thread.o perf-y += thread_map.o -perf-y += trace-event-parse.o perf-y += parse-events-flex.o perf-y += parse-events-bison.o perf-y += pmu.o perf-y += pmu-flex.o perf-y += pmu-bison.o perf-y += pmu-hybrid.o -perf-y += trace-event-read.o -perf-y += trace-event-info.o -perf-y += trace-event-scripting.o -perf-y += trace-event.o +perf-$(CONFIG_TRACEEVENT) += trace-event-info.o +perf-$(CONFIG_TRACEEVENT) += trace-event-scripting.o +perf-$(CONFIG_TRACEEVENT) += trace-event.o +perf-$(CONFIG_TRACEEVENT) += trace-event-parse.o +perf-$(CONFIG_TRACEEVENT) += trace-event-read.o perf-y += svghelper.o perf-y += sort.o perf-y += hist.o
tools/perf/util/data-convert-bt.c +4 -1
@@ -19,7 +19,6 @@#include <babeltrace/ctf-writer/event-fields.h> #include <babeltrace/ctf-ir/utils.h> #include <babeltrace/ctf/events.h> -#include <traceevent/event-parse.h> #include "asm/bug.h" #include "data-convert.h" #include "session.h"
@@ -36,6 +35,10 @@#include "clockid.h" #include "util/sample.h" +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +#define pr_N (n, fmt, ...) \ eprintf(n, debug_data_convert, fmt, ##__VA_ARGS__)
tools/perf/util/data-convert-json.c +8 -1
@@ -27,6 +27,10 @@#include "util/thread.h" #include "util/tool.h" +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +struct convert_json {struct perf_tool tool;FILE *out;
@@ -217,6 +221,7 @@ static int process_sample_event(struct perf_tool *tool, }output_json_format (out, false,3 ,"]" ); +#ifdef HAVE_LIBTRACEEVENT if (sample->raw_data) {int i;struct tep_format_field **fields;
@@ -236,7 +241,7 @@ static int process_sample_event(struct perf_tool *tool, free(fields); } } - +#endif output_json_format (out, false,2 ,"}" );return 0 ; }
@@ -313,7 +318,9 @@ int bt_convert__perf2json(const char *input_name, const char *output_name, .exit = perf_event__process_exit, .fork = perf_event__process_fork, .lost = perf_event__process_lost, +#ifdef HAVE_LIBTRACEEVENT .tracing_data = perf_event__process_tracing_data, +#endif .build_id = perf_event__process_build_id, .id_index = perf_event__process_id_index, .auxtrace_info = perf_event__process_auxtrace_info,
tools/perf/util/evlist.c +5 -1
@@ -290,6 +290,7 @@ struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide)return evsel; } +#ifdef HAVE_LIBTRACEEVENT struct evsel *evlist__add_sched_switch (struct evlist *evlist,bool system_wide) {struct evsel *evsel =evsel__newtp_idx ("sched" ,"sched_switch" ,0 );
@@ -305,7 +306,8 @@ struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide)evlist__add (evlist, evsel); return evsel; -}; +} +#endif int evlist__add_attrs (struct evlist *evlist,struct perf_event_attr *attrs,size_t nr_attrs) {
@@ -376,6 +378,7 @@ struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const charreturn NULL ; } +#ifdef HAVE_LIBTRACEEVENT int evlist__add_newtp (struct evlist *evlist,const char *sys,const char *name,void *handler) {struct evsel *evsel =evsel__newtp (sys, name);
@@ -387,6 +390,7 @@ int evlist__add_newtp(struct evlist *evlist, const char *sys, const char *name,evlist__add (evlist, evsel); return 0; } +#endif struct evlist_cpu_iterator evlist__cpu_begin (struct evlist *evlist,struct affinity *affinity) {
tools/perf/util/evlist.h +4 -0
@@ -127,7 +127,9 @@ static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist) {return evlist__add_aux_dummy (evlist, true); } +#ifdef HAVE_LIBTRACEEVENT struct evsel *evlist__add_sched_switch (struct evlist *evlist,bool system_wide); +#endif int evlist__add_sb_event (struct evlist *evlist,struct perf_event_attr *attr,evsel__sb_cb_t cb,void *data);
@@ -135,7 +137,9 @@ void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data);int evlist__start_sb_thread (struct evlist *evlist,struct target *target);void evlist__stop_sb_thread (struct evlist *evlist); +#ifdef HAVE_LIBTRACEEVENT int evlist__add_newtp (struct evlist *evlist,const char *sys,const char *name,void *handler); +#endif int __evlist__set_tracepoints_handlers(struct evlist *evlist, const struct evsel_str_handler *assocs,
tools/perf/util/evsel.c +10 -1
@@ -12,7 +12,6 @@#include <linux/bitops.h> #include <api/fs/fs.h> #include <api/fs/tracing_path.h> -#include <traceevent/event-parse.h> #include <linux/hw_breakpoint.h> #include <linux/perf_event.h> #include <linux/compiler.h>
@@ -57,6 +56,10 @@#include <linux/ctype.h> +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +struct perf_missing_features perf_missing_features;static clockid_t clockid;
@@ -439,7 +442,9 @@ struct evsel *evsel__clone(struct evsel *orig) goto out_err; } evsel->cgrp =cgroup__get (orig->cgrp); +#ifdef HAVE_LIBTRACEEVENT evsel->tp_format = orig->tp_format; +#endif evsel->handler = orig->handler; evsel->core.leader = orig->core.leader;
@@ -479,6 +484,7 @@ struct evsel *evsel__clone(struct evsel *orig)/* * Returns pointer with encoded error via <linux/err.h> interface. */ +#ifdef HAVE_LIBTRACEEVENT struct evsel *evsel__newtp_idx (const char *sys,const char *name,int idx) {struct evsel *evsel =zalloc (perf_evsel__object.size);
@@ -516,6 +522,7 @@ struct evsel *evsel__newtp_idx(const char *sys, const char *name, int idx) out_err:return ERR_PTR (err); } +#endif const char *const evsel__hw_names[PERF_COUNT_HW_MAX ] = {"cycles" ,
@@ -2758,6 +2765,7 @@ u16 evsel__id_hdr_size(struct evsel *evsel)return size; } +#ifdef HAVE_LIBTRACEEVENT struct tep_format_field *evsel__field (struct evsel *evsel,const char *name) {return tep_find_field (evsel->tp_format, name);
@@ -2831,6 +2839,7 @@ u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *n return field ? format_field__intval(field, sample, evsel->needs_swap) : 0; } +#endif bool evsel__fallback (struct evsel *evsel,int err,char *msg,size_t msgsize) {
tools/perf/util/evsel.h +11 -1
@@ -72,7 +72,9 @@ struct evsel {char *name;char *group_name;const char *pmu_name; +#ifdef HAVE_LIBTRACEEVENT struct tep_event *tp_format; +#endif char *filter;unsigned long max_events;double scale;
@@ -223,11 +225,14 @@ static inline struct evsel *evsel__new(struct perf_event_attr *attr) }struct evsel *evsel__clone (struct evsel *orig); -struct evsel *evsel__newtp_idx (const char *sys,const char *name,int idx);int copy_config_terms (struct list_head *dst,struct list_head *src);void free_config_terms (struct list_head *config_terms); + +#ifdef HAVE_LIBTRACEEVENT +struct evsel *evsel__newtp_idx (const char *sys,const char *name,int idx); +/* * Returns pointer with encoded error via <linux/err.h> interface. */
@@ -235,10 +240,13 @@ static inline struct evsel *evsel__newtp(const char *sys, const char *name) {return evsel__newtp_idx (sys, name,0 ); } +#endif struct evsel *evsel__new_cycles (bool precise,__u32 type,__u64 config); +#ifdef HAVE_LIBTRACEEVENT struct tep_event *event_format__new (const char *sys,const char *name); +#endif void evsel__init (struct evsel *evsel,struct perf_event_attr *attr,int idx);void evsel__exit (struct evsel *evsel);
@@ -323,6 +331,7 @@ bool evsel__precise_ip_fallback(struct evsel *evsel);struct perf_sample ; +#ifdef HAVE_LIBTRACEEVENT void *evsel__rawptr (struct evsel *evsel,struct perf_sample *sample,const char *name);u64 evsel__intval (struct evsel *evsel,struct perf_sample *sample,const char *name);
@@ -330,6 +339,7 @@ static inline char *evsel__strval(struct evsel *evsel, struct perf_sample *sampl {return evsel__rawptr (evsel, sample, name); } +#endif struct tep_format_field ;
tools/perf/util/evsel_fprintf.c +6 -1
@@ -2,7 +2,6 @@#include <inttypes.h> #include <stdio.h> #include <stdbool.h> -#include <traceevent/event-parse.h> #include "evsel.h" #include "util/evsel_fprintf.h" #include "util/event.h"
@@ -13,6 +12,10 @@#include "srcline.h" #include "dso.h" +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +static int comma_fprintf (FILE *fp,bool *first,const char *fmt, ...) {va_list args;
@@ -74,6 +77,7 @@ int evsel__fprintf(struct evsel *evsel, struct perf_attr_details *details, FILE term, (u64)evsel->core.attr.sample_freq); } +#ifdef HAVE_LIBTRACEEVENT if (details->trace_fields) {struct tep_format_field *field;
@@ -96,6 +100,7 @@ int evsel__fprintf(struct evsel *evsel, struct perf_attr_details *details, FILE field = field->next; } } +#endif out:fputc ('\n' , fp);return ++printed;
tools/perf/util/header.c +19 -0
@@ -6,6 +6,7 @@#include <sys/types.h> #include <byteswap.h> #include <unistd.h> +#include <regex.h> #include <stdio.h> #include <stdlib.h> #include <linux/compiler.h>
@@ -55,6 +56,10 @@#include <linux/ctype.h> #include <internal/lib.h> +#ifdef HAVE_LIBTRACEEVENT +#include <traceevent/event-parse.h> +#endif +/* * magic2 = "PERFILE2" * must be a numerical value to let the endianness
@@ -298,6 +303,7 @@ static int do_read_bitmap(struct feat_fd *ff, unsigned long **pset, u64 *psize)return 0 ; } +#ifdef HAVE_LIBTRACEEVENT static int write_tracing_data (struct feat_fd *ff,struct evlist *evlist) {
@@ -306,6 +312,7 @@ static int write_tracing_data(struct feat_fd *ff, return read_tracing_data(ff->fd, &evlist->core.entries); } +#endif static int write_build_id (struct feat_fd *ff,struct evlist *evlist__maybe_unused )
@@ -2394,12 +2401,14 @@ FEAT_PROCESS_STR_FUN(arch, arch);FEAT_PROCESS_STR_FUN (cpudesc, cpu_desc);FEAT_PROCESS_STR_FUN (cpuid, cpuid); +#ifdef HAVE_LIBTRACEEVENT static int process_tracing_data (struct feat_fd *ff,void *data) {ssize_t ret =trace_report (ff->fd, data, false);return ret <0 ?-1 :0 ; } +#endif static int process_build_id (struct feat_fd *ff,void *data__maybe_unused ) {
@@ -3366,7 +3375,9 @@ static int process_pmu_caps(struct feat_fd *ff, void *data __maybe_unused)const struct perf_header_feature_ops feat_ops[HEADER_LAST_FEATURE ];const struct perf_header_feature_ops feat_ops[HEADER_LAST_FEATURE ] = { +#ifdef HAVE_LIBTRACEEVENTFEAT_OPN (TRACING_DATA , tracing_data, false), +#endifFEAT_OPN (BUILD_ID , build_id, false),FEAT_OPR (HOSTNAME , hostname, false),FEAT_OPR (OSRELEASE , osrelease, false),
@@ -4082,6 +4093,7 @@ static int read_attr(int fd, struct perf_header *ph,return ret <=0 ?-1 :0 ; } +#ifdef HAVE_LIBTRACEEVENT static int evsel__prepare_tracepoint_event (struct evsel *evsel,struct tep_handle *pevent) {struct tep_event *event;
@@ -4125,6 +4137,7 @@ static int evlist__prepare_tracepoint_events(struct evlist *evlist, struct tep_h return 0; } +#endif int perf_session__read_header (struct perf_session *session,int repipe_fd) {
@@ -4230,11 +4243,15 @@ int perf_session__read_header(struct perf_session *session, int repipe_fd)lseek (fd, tmp,SEEK_SET ); } +#ifdef HAVE_LIBTRACEEVENT perf_header__process_sections (header, fd, &session->tevent, perf_file_section__process);if (evlist__prepare_tracepoint_events (session->evlist, session->tevent.pevent)) goto out_delete_evlist; +#else +perf_header__process_sections (header, fd,NULL , perf_file_section__process); +#endif return 0 ; out_errno:
@@ -4412,6 +4429,7 @@ int perf_event__process_event_update(struct perf_tool *tool __maybe_unused,return 0 ; } +#ifdef HAVE_LIBTRACEEVENT int perf_event__process_tracing_data (struct perf_session *session,union perf_event *event) {
@@ -4459,6 +4477,7 @@ int perf_event__process_tracing_data(struct perf_session *session, return size_read + padding; } +#endif int perf_event__process_build_id (struct perf_session *session,union perf_event *event)
tools/perf/util/header.h +2 -0
@@ -160,8 +160,10 @@ int perf_event__process_event_update(struct perf_tool *tool,union perf_event *event, struct evlist **pevlist);size_t perf_event__fprintf_event_update (union perf_event *event,FILE *fp); +#ifdef HAVE_LIBTRACEEVENT int perf_event__process_tracing_data (struct perf_session *session,union perf_event *event); +#endif int perf_event__process_build_id (struct perf_session *session,union perf_event *event);bool is_perf_magic (u64 magic);
tools/perf/util/intel-pt.c +6 -1
@@ -3142,6 +3142,7 @@ static int intel_pt_sync_switch(struct intel_pt *pt, int cpu, pid_t tid,return 1 ; } +#ifdef HAVE_LIBTRACEEVENT static int intel_pt_process_switch (struct intel_pt *pt,struct perf_sample *sample) {
@@ -3165,6 +3166,7 @@ static int intel_pt_process_switch(struct intel_pt *pt, return machine__set_current_tid(pt->machine, cpu, -1, tid); } +#endif /* HAVE_LIBTRACEEVENT */ static int intel_pt_context_switch_in (struct intel_pt *pt,struct perf_sample *sample)
@@ -3433,9 +3435,12 @@ static int intel_pt_process_event(struct perf_session *session,return err; } +#ifdef HAVE_LIBTRACEEVENT if (pt->switch_evsel && event->header.type ==PERF_RECORD_SAMPLE ) err =intel_pt_process_switch (pt, sample); -else if (event->header.type ==PERF_RECORD_ITRACE_START ) + else +#endif +if (event->header.type ==PERF_RECORD_ITRACE_START ) err =intel_pt_process_itrace_start (pt, event, sample);else if (event->header.type ==PERF_RECORD_AUX_OUTPUT_HW_ID ) err =intel_pt_process_aux_output_hw_id (pt, event, sample);
tools/perf/util/parse-events.c +15 -0
@@ -445,6 +445,7 @@ int parse_events_add_cache(struct list_head *list, int *idx,return ret; } +#ifdef HAVE_LIBTRACEEVENT static void tracepoint_error (struct parse_events_error *e,int err,const char *sys,const char *name) {
@@ -593,6 +594,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,closedir (events_dir);return ret; } +#endif /* HAVE_LIBTRACEEVENT */ #ifdef HAVE_LIBBPF_SUPPORT struct __add_bpf_event_param {
@@ -1143,6 +1145,7 @@ static int config_term_pmu(struct perf_event_attr *attr,return config_term_common (attr, term, err); } +#ifdef HAVE_LIBTRACEEVENT static int config_term_tracepoint (struct perf_event_attr *attr,struct parse_events_term *term,struct parse_events_error *err)
@@ -1170,6 +1173,7 @@ static int config_term_tracepoint(struct perf_event_attr *attr,return 0 ; } +#endif static int config_attr(struct perf_event_attr *attr, struct list_head *head,
@@ -1325,6 +1329,7 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx,struct parse_events_error *err, struct list_head *head_config) { +#ifdef HAVE_LIBTRACEEVENT if (head_config) { struct perf_event_attr attr;
@@ -1339,6 +1344,16 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx, else return add_tracepoint_event(list, idx, sys, event,err ,head_config ); +#else + (void )list; + (void )idx; + (void )sys; + (void )event; + (void )head_config; +parse_events_error__handle (err,0 ,strdup ("unsupported tracepoint" ), +strdup ("libtraceevent is necessary for tracepoint support" )); +return -1 ; +#endif } int parse_events_add_numeric(struct parse_events_state *parse_state,
tools/perf/util/parse-events.h +0 -1
@@ -18,7 +18,6 @@ struct parse_events_error;struct option ;struct perf_pmu ; -bool have_tracepoints (struct list_head *evlist);bool is_event_supported (u8 type,u64 config);const char *event_type (int type);
tools/perf/util/python.c +4 -0
@@ -417,6 +417,7 @@ static PyObject *pyrf_sample_event__repr(struct pyrf_event *pevent)return ret; } +#ifdef HAVE_LIBTRACEEVENT static bool is_tracepoint (struct pyrf_event *pevent) {return pevent->evsel->core.attr.type ==PERF_TYPE_TRACEPOINT ;
@@ -486,14 +487,17 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name) return tracepoint_field(pevent, field); } +#endif /* HAVE_LIBTRACEEVENT */ static PyObject *pyrf_sample_event__getattro (struct pyrf_event *pevent,PyObject *attr_name) {PyObject *obj =NULL ; +#ifdef HAVE_LIBTRACEEVENT if (is_tracepoint (pevent)) obj =get_tracepoint_field (pevent, attr_name); +#endif return obj ?:PyObject_GenericGetAttr ((PyObject *) pevent, attr_name); }
tools/perf/util/scripting-engines/Build +4 -2
@@ -1,5 +1,7 @@ -perf-$(CONFIG_LIBPERL) += trace-event-perl.o -perf-$(CONFIG_LIBPYTHON) += trace-event-python.o +ifeq ($(CONFIG_TRACEEVENT),y) + perf-$(CONFIG_LIBPERL) += trace-event-perl.o + perf-$(CONFIG_LIBPYTHON) += trace-event-python.o +endif CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-nested-externs -Wno-undef -Wno-switch-default -Wno-bad-function-cast -Wno-declaration-after-statement -Wno-switch-enum
tools/perf/util/scripting-engines/trace-event-python.c +1 -0
@@ -30,6 +30,7 @@#include <linux/bitmap.h> #include <linux/compiler.h> #include <linux/time64.h> +#include <traceevent/event-parse.h> #include "../build-id.h" #include "../counts.h"
tools/perf/util/session.c +2 -0
@@ -314,7 +314,9 @@ void perf_session__delete(struct perf_session *session)evlist__delete (session->evlist);perf_data__close (session->data); } +#ifdef HAVE_LIBTRACEEVENT trace_event__cleanup (&session->tevent); +#endif free (session); }
tools/perf/util/session.h +2 -0
@@ -33,7 +33,9 @@ struct perf_session {struct auxtrace *auxtrace;struct itrace_synth_opts *itrace_synth_opts;struct list_head auxtrace_index; +#ifdef HAVE_LIBTRACEEVENT struct trace_event tevent; +#endif struct perf_record_time_conv time_conv;bool repipe;bool one_mmap;
tools/perf/util/sort.c +50 -10
212 lines not on this page · raw message
tools/perf/util/synthetic-events.c +6 -0
@@ -2157,6 +2157,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool, struct perf_event_attr *return err; } +#ifdef HAVE_LIBTRACEEVENT int perf_event__synthesize_tracing_data (struct perf_tool *tool,int fd,struct evlist *evlist,perf_event__handler_t process) {
@@ -2203,6 +2204,7 @@ int perf_event__synthesize_tracing_data(struct perf_tool *tool, int fd, struct e return aligned_size; } +#endif int perf_event__synthesize_build_id (struct perf_tool *tool,struct dso *pos,u16 misc,perf_event__handler_t process,struct machine *machine)
@@ -2355,6 +2357,7 @@ int perf_event__synthesize_for_pipe(struct perf_tool *tool, } ret += err; +#ifdef HAVE_LIBTRACEEVENT if (have_tracepoints (&evlist->core.entries)) {int fd =perf_data__fd (data);
@@ -2374,6 +2377,9 @@ int perf_event__synthesize_for_pipe(struct perf_tool *tool, } ret += err; } +#else + (void )data; +#endif return ret; }
tools/perf/util/trace-event-parse.c +2 -0
@@ -11,6 +11,8 @@#include "trace-event.h" #include <linux/ctype.h> +#include <linux/kernel.h> +#include <traceevent/event-parse.h> static int get_common_field (struct scripting_context *context,int *offset,int *size,const char *type)
tools/perf/util/trace-event-read.c +1 -0
@@ -11,6 +11,7 @@#include <sys/stat.h> #include <sys/wait.h> #include <sys/mman.h> +#include <traceevent/event-parse.h> #include <fcntl.h> #include <unistd.h> #include <errno.h>
tools/perf/util/trace-event-scripting.c +1 -0
@@ -9,6 +9,7 @@#include <stdlib.h> #include <string.h> #include <errno.h> +#include <traceevent/event-parse.h> #include "debug.h" #include "trace-event.h"
tools/perf/util/trace-event.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#include <stdio.h> #include <unistd.h> #include <stdlib.h>
tools/perf/util/trace-event.h +9 -2
@@ -2,9 +2,11 @@#ifndef _PERF_UTIL_TRACE_EVENT_H#define _PERF_UTIL_TRACE_EVENT_H -#include <traceevent/event-parse.h> -#include "parse-events.h" +#include <stdbool.h> +#include <stdio.h> +#include <linux/types.h> +struct evlist ;struct machine ;struct perf_sample ;union perf_event ;
@@ -18,6 +20,11 @@ struct trace_event {struct tep_plugin_list *plugin_list; }; +typedef char *(tep_func_resolver_t )(void *priv, +unsigned long long *addrp,char **modp); + +bool have_tracepoints (struct list_head *evlist); +int trace_event__init (struct trace_event *t);void trace_event__cleanup (struct trace_event *t); int trace_event__register_resolver(struct machine *machine,
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Namhyung Kim
maintainerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Quoted 10 lines · Ian Rogers
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
Thanks,
Namhyung
Ian Rogers
reviewerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Quoted 13 lines · Namhyung Kim
Quoted 10 lines · Ian Rogers
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".
Quoted 4 lines
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
Sounds like a worthwhile refactor that can land on top of this change.
Quoted 5 lines
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
The issue here is that perf lock contention will use evsel__new_tp and internally that uses libtraceevent. As such it is removed without HAVE_LIBTRACEEVENT. Without the evsel there's not much perf lock contention can do, so rather than litter the code with HAVE_LIBTRACEEVENT and for it to be broken, I made the choice just to remove it from the no libtraceevent build for now.
I think it is worth pursuing these patches in the shape they are in so that we can land the removal of tools/lib/traceevent and ensure the migration away from an out-of-date version of that library.
Thanks,
Ian
Quoted 2 lines
Thanks,
Namhyung
Namhyung Kim
maintainerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Quoted 28 lines · Ian Rogers
Quoted 13 lines · Namhyung Kim
Quoted 10 lines · Ian Rogers
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".Quoted 4 lines
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
Sounds like a worthwhile refactor that can land on top of this change.
Quoted 5 lines
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
Quoted 6 lines
The issue here is that perf lock contention will use
evsel__new_tpand internally that uses libtraceevent. As such it is removed withoutHAVE_LIBTRACEEVENT. Without the evsel there's not much perf lock contention can do, so rather than litter the code withHAVE_LIBTRACEEVENTand for it to be broken, I made the choice just to remove it from the no libtraceevent build for now.
I don't think it needs evsel__new_tp() when BPF is used. The BPF program is attached to the raw tracepoint without perf_event and the result is written to the BPF map.
Quoted 4 lines
I think it is worth pursuing these patches in the shape they are in so that we can land the removal of
tools/lib/traceeventand ensure the migration away from an out-of-date version of that library.
Yeah, I agree that we should remove the stale libtraceevent but I'd like to do it with minimal changes in the perf code base. Let me take a look at this.
Thanks,
Namhyung
Arnaldo Carvalho de Melo
maintainerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Em Fri, Dec 02, 2022 at 10:08:04AM -0800, Namhyung Kim escreveu:
Quoted 41 lines · Ian Rogers
Quoted 28 lines · Namhyung Kim
Quoted 13 lines · Ian Rogers
Quoted 10 lines
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".Quoted 4 lines
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
Sounds like a worthwhile refactor that can land on top of this change.
Quoted 5 lines
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
Quoted 6 lines
The issue here is that perf lock contention will use
evsel__new_tpand internally that uses libtraceevent. As such it is removed withoutHAVE_LIBTRACEEVENT. Without the evsel there's not much perf lock contention can do, so rather than litter the code withHAVE_LIBTRACEEVENTand for it to be broken, I made the choice just to remove it from the no libtraceevent build for now.I don't think it needs
evsel__new_tp()when BPF is used. The BPF program is attached to the raw tracepoint withoutperf_eventand the result is written to the BPF map.Quoted 1 line
Quoted 7 lines
Quoted 3 lines
I think it is worth pursuing these patches in the shape they are in so that we can land the removal of
tools/lib/traceeventand ensure the migration away from an out-of-date version of that library.Yeah, I agree that we should remove the stale libtraceevent but I'd like to do it with minimal changes in the perf code base. Let me take a look at this.
Ok, was going to take a look at this patchkit, will wait for you now.
- Arnaldo
Ian Rogers
reviewerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Quoted 47 lines · Arnaldo Carvalho de Melo
Em Fri, Dec 02, 2022 at 10:08:04AM -0800, Namhyung Kim escreveu:
Quoted 45 lines · Ian Rogers
Quoted 28 lines · Namhyung Kim
Quoted 13 lines · Ian Rogers
Quoted 10 lines
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".Quoted 4 lines
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
Sounds like a worthwhile refactor that can land on top of this change.
Quoted 5 lines
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
Quoted 6 lines
The issue here is that perf lock contention will use
evsel__new_tpand internally that uses libtraceevent. As such it is removed withoutHAVE_LIBTRACEEVENT. Without the evsel there's not much perf lock contention can do, so rather than litter the code withHAVE_LIBTRACEEVENTand for it to be broken, I made the choice just to remove it from the no libtraceevent build for now.I don't think it needs
evsel__new_tp()when BPF is used. The BPF program is attached to the raw tracepoint withoutperf_eventand the result is written to the BPF map.Quoted 4 lines
I think it is worth pursuing these patches in the shape they are in so that we can land the removal of
tools/lib/traceeventand ensure the migration away from an out-of-date version of that library.
Quoted 7 lines
Quoted 3 lines
Yeah, I agree that we should remove the stale libtraceevent but I'd like to do it with minimal changes in the perf code base. Let me take a look at this.
Ok, was going to take a look at this patchkit, will wait for you now.
- Arnaldo
So the problematic function is:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/evsel.c?h=perf/core#n482
struct evsel *evsel__newtp_idx(const char *sys, const char *name, int idx)
on success it will always initialize:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/evsel.c?h=perf/core#n499evsel->tp_format = trace_event__tp_format(sys, name);
tp_format is a libtraceevent type so this patch makes the variable conditional on HAVE_LIBTRACEEVENT. I think this will remain true even with a new evsel__newtp function that isn't dependent on libtraceevent. I also think adding such things is best kept out of this patch which is trying to do the minimal (only 312 lines of addition) to have a build without libtraceevent.
Given we expect builds to use libtraceevent and we should build off of this patch, I think we should look to land it for 6.2.
Thanks,
Ian
Namhyung Kim
maintainerRe: [PATCH v2 3/4] perf build: Use libtraceevent from the system
Quoted 73 lines · Ian Rogers
Quoted 47 lines · Arnaldo Carvalho de Melo
Em Fri, Dec 02, 2022 at 10:08:04AM -0800, Namhyung Kim escreveu:
Quoted 45 lines · Ian Rogers
Quoted 28 lines · Namhyung Kim
Quoted 13 lines · Ian Rogers
Quoted 10 lines
Remove the
LIBTRACEEVENT_DYNAMICandLIBTRACEFS_DYNAMIC. If libtraceevent isn't installed or NO_LIBTRACEEVENT=1 is passed to the build, don't compile in libtraceevent and libtracefs support. This also disablesCONFIG_TRACEthat controls "perf
trace".CONFIG_TRACEEVENTis used to control enablement in Build/Makefiles,HAVE_LIBTRACEEVENTis used in C code. WithoutHAVE_LIBTRACEEVENTtracepoints are disabled and as such the commands kmem, kwork, lock, sched and timechart are removed. The majority of commands continue to work including "perf test".Quoted 4 lines
Maybe we can have a different approach. I guess the trace data access is isolated then we can make dummy interfaces when there's no libtraceevent. This way we don't need to touch every command and let it fail when it's asked.
Sounds like a worthwhile refactor that can land on top of this change.
Quoted 5 lines
The motivation is that we should be able to run the sub-commands as much as possible. In fact, we could run 'record' part only on the target machine and pass the data to the host for analysis with a full-fledged perf. Also some commands like 'perf lock contention' can run with or without libtraceevent (using BPF only).
Quoted 6 lines
The issue here is that perf lock contention will use
evsel__new_tpand internally that uses libtraceevent. As such it is removed withoutHAVE_LIBTRACEEVENT. Without the evsel there's not much perf lock contention can do, so rather than litter the code withHAVE_LIBTRACEEVENTand for it to be broken, I made the choice just to remove it from the no libtraceevent build for now.I don't think it needs
evsel__new_tp()when BPF is used. The BPF program is attached to the raw tracepoint withoutperf_eventand the result is written to the BPF map.Quoted 4 lines
I think it is worth pursuing these patches in the shape they are in so that we can land the removal of
tools/lib/traceeventand ensure the migration away from an out-of-date version of that library.Quoted 7 lines
Quoted 3 lines
Yeah, I agree that we should remove the stale libtraceevent but I'd like to do it with minimal changes in the perf code base. Let me take a look at this.
Ok, was going to take a look at this patchkit, will wait for you now.
- Arnaldo
So the problematic function is:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/evsel.c?h=perf/core#n482
struct evsel *evsel__newtp_idx(const char *sys, const char *name, int idx)on success it will always initialize:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/util/evsel.c?h=perf/core#n499evsel->tp_format=trace_event__tp_format(sys, name);
tp_formatis a libtraceevent type so this patch makes the variable conditional onHAVE_LIBTRACEEVENT. I think this will remain true even with a newevsel__newtpfunction that isn't dependent on libtraceevent. I also think adding such things is best kept out of this patch which is trying to do the minimal (only 312 lines of addition) to have a build without libtraceevent.
Quoted 2 lines
Given we expect builds to use libtraceevent and we should build off of this patch, I think we should look to land it for 6.2.
So I took a quick look and it seems not quite easy to isolate libtraceevent accesses from perf trace, dynamic sort keys and other places. That would need some amount of work.
Now I think that we may apply this first and then work on enabling more functionalities without libtraceevent gradually.
Also I think it'd be a major change for regular users if there's no libtraceevent installed in their system. Maybe we could add a warning during the build?
Thanks,
Namhyung
Ian Rogers
reviewerPATCH v2 4/4 tools lib traceevent: Remove libtraceevent
In reply to Ian Rogerslibtraceevent is now out-of-date and it is better to depend on the system version. Remove this code that is no longer depended upon by any builds.
--- tools/lib/traceevent/.gitignore | 4 - tools/lib/traceevent/Build | 8 - tools/lib/traceevent/Documentation/Makefile | 207 - .../traceevent/Documentation/asciidoc.conf | 120 - .../Documentation/libtraceevent-commands.txt | 153 - .../Documentation/libtraceevent-cpus.txt | 77 - .../libtraceevent-endian_read.txt | 78 - .../libtraceevent-event_find.txt | 103 - .../Documentation/libtraceevent-event_get.txt | 99 - .../libtraceevent-event_list.txt | 122 - .../libtraceevent-event_print.txt | 130 - .../libtraceevent-field_find.txt | 118 - .../libtraceevent-field_get_val.txt | 122 - .../libtraceevent-field_print.txt | 126 - .../libtraceevent-field_read.txt | 81 - .../Documentation/libtraceevent-fields.txt | 105 - .../libtraceevent-file_endian.txt | 91 - .../Documentation/libtraceevent-filter.txt | 209 - .../Documentation/libtraceevent-func_apis.txt | 183 - .../Documentation/libtraceevent-func_find.txt | 88 - .../Documentation/libtraceevent-handle.txt | 101 - .../libtraceevent-header_page.txt | 102 - .../libtraceevent-host_endian.txt | 104 - .../Documentation/libtraceevent-long_size.txt | 78 - .../Documentation/libtraceevent-page_size.txt | 82 - .../libtraceevent-parse_event.txt | 90 - .../libtraceevent-parse_head.txt | 82 - .../Documentation/libtraceevent-plugins.txt | 122 - .../libtraceevent-record_parse.txt | 137 - .../libtraceevent-reg_event_handler.txt | 156 - .../libtraceevent-reg_print_func.txt | 155 - .../Documentation/libtraceevent-set_flag.txt | 104 - .../Documentation/libtraceevent-strerror.txt | 85 - .../Documentation/libtraceevent-tseq.txt | 158 - .../Documentation/libtraceevent.txt | 192 - .../traceevent/Documentation/manpage-1.72.xsl | 14 - .../traceevent/Documentation/manpage-base.xsl | 35 - .../Documentation/manpage-bold-literal.xsl | 17 - .../Documentation/manpage-normal.xsl | 13 - .../Documentation/manpage-suppress-sp.xsl | 21 - tools/lib/traceevent/Makefile | 300 - tools/lib/traceevent/event-parse-api.c | 333 - tools/lib/traceevent/event-parse-local.h | 123 - tools/lib/traceevent/event-parse.c | 7624 ----------------- tools/lib/traceevent/event-parse.h | 750 -- tools/lib/traceevent/event-plugin.c | 711 -- tools/lib/traceevent/event-utils.h | 67 - tools/lib/traceevent/kbuffer-parse.c | 809 -- tools/lib/traceevent/kbuffer.h | 68 - .../lib/traceevent/libtraceevent.pc.template | 10 - tools/lib/traceevent/parse-filter.c | 2281 ----- tools/lib/traceevent/parse-utils.c | 71 - tools/lib/traceevent/plugins/Build | 12 - tools/lib/traceevent/plugins/Makefile | 225 - .../lib/traceevent/plugins/plugin_cfg80211.c | 43 - .../lib/traceevent/plugins/plugin_function.c | 282 - tools/lib/traceevent/plugins/plugin_futex.c | 123 - tools/lib/traceevent/plugins/plugin_hrtimer.c | 74 - tools/lib/traceevent/plugins/plugin_jbd2.c | 61 - tools/lib/traceevent/plugins/plugin_kmem.c | 80 - tools/lib/traceevent/plugins/plugin_kvm.c | 527 -- .../lib/traceevent/plugins/plugin_mac80211.c | 88 - .../traceevent/plugins/plugin_sched_switch.c | 146 - tools/lib/traceevent/plugins/plugin_scsi.c | 434 - tools/lib/traceevent/plugins/plugin_tlb.c | 66 - tools/lib/traceevent/plugins/plugin_xen.c | 138 - tools/lib/traceevent/tep_strerror.c | 53 - tools/lib/traceevent/trace-seq.c | 249 - tools/lib/traceevent/trace-seq.h | 55 - 69 files changed, 19875 deletions(-) delete mode 100644 tools/lib/traceevent/.gitignore delete mode 100644 tools/lib/traceevent/Build delete mode 100644 tools/lib/traceevent/Documentation/Makefile delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl delete mode 100644 tools/lib/traceevent/Makefile delete mode 100644 tools/lib/traceevent/event-parse-api.c delete mode 100644 tools/lib/traceevent/event-parse-local.h delete mode 100644 tools/lib/traceevent/event-parse.c delete mode 100644 tools/lib/traceevent/event-parse.h delete mode 100644 tools/lib/traceevent/event-plugin.c delete mode 100644 tools/lib/traceevent/event-utils.h delete mode 100644 tools/lib/traceevent/kbuffer-parse.c delete mode 100644 tools/lib/traceevent/kbuffer.h delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template delete mode 100644 tools/lib/traceevent/parse-filter.c delete mode 100644 tools/lib/traceevent/parse-utils.c delete mode 100644 tools/lib/traceevent/plugins/Build delete mode 100644 tools/lib/traceevent/plugins/Makefile delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c delete mode 100644 tools/lib/traceevent/tep_strerror.c delete mode 100644 tools/lib/traceevent/trace-seq.c delete mode 100644 tools/lib/traceevent/trace-seq.h
tools/lib/traceevent/.gitignore deleted +0 -4
@@ -1,4 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -TRACEEVENT-CFLAGS -libtraceevent-dynamic-list -libtraceevent.so.*
tools/lib/traceevent/Build deleted +0 -8
@@ -1,8 +0,0 @@ -libtraceevent-y += event-parse.o -libtraceevent-y += event-plugin.o -libtraceevent-y += trace-seq.o -libtraceevent-y += parse-filter.o -libtraceevent-y += parse-utils.o -libtraceevent-y += kbuffer-parse.o -libtraceevent-y += tep_strerror.o -libtraceevent-y += event-parse-api.o
tools/lib/traceevent/Documentation/Makefile deleted +0 -207
207 lines not on this page · raw message
tools/lib/traceevent/Documentation/asciidoc.conf deleted +0 -120
120 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-commands.txt deleted +0 -153
153 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-cpus.txt deleted +0 -77
77 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt deleted +0 -78
78 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-event_find.txt deleted +0 -103
103 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-event_get.txt deleted +0 -99
99 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-event_list.txt deleted +0 -122
122 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-event_print.txt deleted +0 -130
130 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-field_find.txt deleted +0 -118
118 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt deleted +0 -122
122 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-field_print.txt deleted +0 -126
126 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-field_read.txt deleted +0 -81
81 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-fields.txt deleted +0 -105
105 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt deleted +0 -91
91 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-filter.txt deleted +0 -209
209 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt deleted +0 -183
183 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-func_find.txt deleted +0 -88
88 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-handle.txt deleted +0 -101
101 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-header_page.txt deleted +0 -102
102 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt deleted +0 -104
104 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-long_size.txt deleted +0 -78
78 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-page_size.txt deleted +0 -82
82 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt deleted +0 -90
90 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt deleted +0 -82
82 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-plugins.txt deleted +0 -122
122 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt deleted +0 -137
15 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt deleted +0 -156
156 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt deleted +0 -155
155 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt deleted +0 -104
104 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-strerror.txt deleted +0 -85
85 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent-tseq.txt deleted +0 -158
158 lines not on this page · raw message
tools/lib/traceevent/Documentation/libtraceevent.txt deleted +0 -192
192 lines not on this page · raw message
tools/lib/traceevent/Documentation/manpage-1.72.xsl deleted +0 -14
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-base.xsl deleted +0 -35
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-bold-literal.xsl deleted +0 -17
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-normal.xsl deleted +0 -13
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl deleted +0 -21
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Makefile deleted +0 -300
300 lines not on this page · raw message
tools/lib/traceevent/event-parse-api.c deleted +0 -333
333 lines not on this page · raw message
tools/lib/traceevent/event-parse-local.h deleted +0 -123
123 lines not on this page · raw message
tools/lib/traceevent/event-parse.c deleted +0 -7624
7,624 lines not on this page · raw message
tools/lib/traceevent/event-parse.h deleted +0 -750
750 lines not on this page · raw message
tools/lib/traceevent/event-plugin.c deleted +0 -711
711 lines not on this page · raw message
tools/lib/traceevent/event-utils.h deleted +0 -67
67 lines not on this page · raw message
tools/lib/traceevent/kbuffer-parse.c deleted +0 -809
809 lines not on this page · raw message
tools/lib/traceevent/kbuffer.h deleted +0 -68
68 lines not on this page · raw message
tools/lib/traceevent/libtraceevent.pc.template deleted +0 -10
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/parse-filter.c deleted +0 -2281
2,281 lines not on this page · raw message
tools/lib/traceevent/parse-utils.c deleted +0 -71
71 lines not on this page · raw message
tools/lib/traceevent/plugins/Build deleted +0 -12
Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/Makefile deleted +0 -225
225 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_cfg80211.c deleted +0 -43
43 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_function.c deleted +0 -282
282 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_futex.c deleted +0 -123
123 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_hrtimer.c deleted +0 -74
74 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_jbd2.c deleted +0 -61
61 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_kmem.c deleted +0 -80
80 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_kvm.c deleted +0 -527
527 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_mac80211.c deleted +0 -88
88 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_sched_switch.c deleted +0 -146
146 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_scsi.c deleted +0 -434
434 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_tlb.c deleted +0 -66
66 lines not on this page · raw message
tools/lib/traceevent/plugins/plugin_xen.c deleted +0 -138
138 lines not on this page · raw message
tools/lib/traceevent/tep_strerror.c deleted +0 -53
53 lines not on this page · raw message
tools/lib/traceevent/trace-seq.c deleted +0 -249
249 lines not on this page · raw message
tools/lib/traceevent/trace-seq.h deleted +0 -55
55 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Part of the diff is not shown here. View the raw message.
Re: [PATCH v2 4/4] tools lib traceevent: Remove libtraceevent
Em Tue, Nov 29, 2022 at 10:29:35PM -0800, Ian Rogers escreveu:
Quoted 3 lines
libtraceevent is now out-of-date and it is better to depend on the system version. Remove this code that is no longer depended upon by any builds.
Thanks, applied and Added Steven's Acked-by.
- Arnaldo
Quoted 20,434 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/lib/traceevent/.gitignore | 4 - tools/lib/traceevent/Build | 8 - tools/lib/traceevent/Documentation/Makefile | 207 - .../traceevent/Documentation/asciidoc.conf | 120 - .../Documentation/libtraceevent-commands.txt | 153 - .../Documentation/libtraceevent-cpus.txt | 77 - .../libtraceevent-endian_read.txt | 78 - .../libtraceevent-event_find.txt | 103 - .../Documentation/libtraceevent-event_get.txt | 99 - .../libtraceevent-event_list.txt | 122 - .../libtraceevent-event_print.txt | 130 - .../libtraceevent-field_find.txt | 118 - .../libtraceevent-field_get_val.txt | 122 - .../libtraceevent-field_print.txt | 126 - .../libtraceevent-field_read.txt | 81 - .../Documentation/libtraceevent-fields.txt | 105 - .../libtraceevent-file_endian.txt | 91 - .../Documentation/libtraceevent-filter.txt | 209 - .../Documentation/libtraceevent-func_apis.txt | 183 - .../Documentation/libtraceevent-func_find.txt | 88 - .../Documentation/libtraceevent-handle.txt | 101 - .../libtraceevent-header_page.txt | 102 - .../libtraceevent-host_endian.txt | 104 - .../Documentation/libtraceevent-long_size.txt | 78 - .../Documentation/libtraceevent-page_size.txt | 82 - .../libtraceevent-parse_event.txt | 90 - .../libtraceevent-parse_head.txt | 82 - .../Documentation/libtraceevent-plugins.txt | 122 - .../libtraceevent-record_parse.txt | 137 - .../libtraceevent-reg_event_handler.txt | 156 - .../libtraceevent-reg_print_func.txt | 155 - .../Documentation/libtraceevent-set_flag.txt | 104 - .../Documentation/libtraceevent-strerror.txt | 85 - .../Documentation/libtraceevent-tseq.txt | 158 - .../Documentation/libtraceevent.txt | 192 - .../traceevent/Documentation/manpage-1.72.xsl | 14 - .../traceevent/Documentation/manpage-base.xsl | 35 - .../Documentation/manpage-bold-literal.xsl | 17 - .../Documentation/manpage-normal.xsl | 13 - .../Documentation/manpage-suppress-sp.xsl | 21 - tools/lib/traceevent/Makefile | 300 - tools/lib/traceevent/event-parse-api.c | 333 - tools/lib/traceevent/event-parse-local.h | 123 - tools/lib/traceevent/event-parse.c | 7624 ----------------- tools/lib/traceevent/event-parse.h | 750 -- tools/lib/traceevent/event-plugin.c | 711 -- tools/lib/traceevent/event-utils.h | 67 - tools/lib/traceevent/kbuffer-parse.c | 809 -- tools/lib/traceevent/kbuffer.h | 68 - .../lib/traceevent/libtraceevent.pc.template | 10 - tools/lib/traceevent/parse-filter.c | 2281 ----- tools/lib/traceevent/parse-utils.c | 71 - tools/lib/traceevent/plugins/Build | 12 - tools/lib/traceevent/plugins/Makefile | 225 - .../lib/traceevent/plugins/plugin_cfg80211.c | 43 - .../lib/traceevent/plugins/plugin_function.c | 282 - tools/lib/traceevent/plugins/plugin_futex.c | 123 - tools/lib/traceevent/plugins/plugin_hrtimer.c | 74 - tools/lib/traceevent/plugins/plugin_jbd2.c | 61 - tools/lib/traceevent/plugins/plugin_kmem.c | 80 - tools/lib/traceevent/plugins/plugin_kvm.c | 527 -- .../lib/traceevent/plugins/plugin_mac80211.c | 88 - .../traceevent/plugins/plugin_sched_switch.c | 146 - tools/lib/traceevent/plugins/plugin_scsi.c | 434 - tools/lib/traceevent/plugins/plugin_tlb.c | 66 - tools/lib/traceevent/plugins/plugin_xen.c | 138 - tools/lib/traceevent/tep_strerror.c | 53 - tools/lib/traceevent/trace-seq.c | 249 - tools/lib/traceevent/trace-seq.h | 55 - 69 files changed, 19875 deletions(-) delete mode 100644 tools/lib/traceevent/.gitignore delete mode 100644 tools/lib/traceevent/Build delete mode 100644 tools/lib/traceevent/Documentation/Makefile delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl delete mode 100644 tools/lib/traceevent/Makefile delete mode 100644 tools/lib/traceevent/event-parse-api.c delete mode 100644 tools/lib/traceevent/event-parse-local.h delete mode 100644 tools/lib/traceevent/event-parse.c delete mode 100644 tools/lib/traceevent/event-parse.h delete mode 100644 tools/lib/traceevent/event-plugin.c delete mode 100644 tools/lib/traceevent/event-utils.h delete mode 100644 tools/lib/traceevent/kbuffer-parse.c delete mode 100644 tools/lib/traceevent/kbuffer.h delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template delete mode 100644 tools/lib/traceevent/parse-filter.c delete mode 100644 tools/lib/traceevent/parse-utils.c delete mode 100644 tools/lib/traceevent/plugins/Build delete mode 100644 tools/lib/traceevent/plugins/Makefile delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c delete mode 100644 tools/lib/traceevent/tep_strerror.c delete mode 100644 tools/lib/traceevent/trace-seq.c delete mode 100644 tools/lib/traceevent/trace-seq.htools/lib/traceevent/.gitignore deleted +0
-4@@ -1,4 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -TRACEEVENT-CFLAGS -libtraceevent-dynamic-list -libtraceevent.so.*tools/lib/traceevent/Build deleted +0
-8@@ -1,8 +0,0 @@ -libtraceevent-y += event-parse.o -libtraceevent-y += event-plugin.o -libtraceevent-y += trace-seq.o -libtraceevent-y += parse-filter.o -libtraceevent-y += parse-utils.o -libtraceevent-y += kbuffer-parse.o -libtraceevent-y += tep_strerror.o -libtraceevent-y += event-parse-api.otools/lib/traceevent/Documentation/Makefile deleted +0
-207@@ -1,207 +0,0 @@ -include ../../../scripts/Makefile.include -include ../../../scripts/utilities.mak - -# This Makefile and manpage XSL files were taken from tools/perf/Documentation -# and modified for libtraceevent. - -MAN3_TXT= \ - $(wildcard libtraceevent-*.txt) \ - libtraceevent.txt - -MAN_TXT = $(MAN3_TXT) -_MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) -_MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) -_DOC_MAN3=$(patsubst %.txt,%.3,$(MAN3_TXT)) - -MAN_XML=$(addprefix $(OUTPUT),$(_MAN_XML)) -MAN_HTML=$(addprefix $(OUTPUT),$(_MAN_HTML)) -DOC_MAN3=$(addprefix $(OUTPUT),$(_DOC_MAN3)) - -# Make the path relative to DESTDIR, not prefix -ifndef DESTDIR -prefix?=$(HOME) -endif -bindir?=$(prefix)/bin -htmldir?=$(prefix)/share/doc/libtraceevent-doc -pdfdir?=$(prefix)/share/doc/libtraceevent-doc -mandir?=$(prefix)/share/man -man3dir=$(mandir)/man3 - -ASCIIDOC=asciidoc -ASCIIDOC_EXTRA = --unsafe -f asciidoc.conf -ASCIIDOC_HTML = xhtml11 -MANPAGE_XSL = manpage-normal.xsl -XMLTO_EXTRA = -INSTALL?=install -RM ?= rm -f - -ifdef USE_ASCIIDOCTOR -ASCIIDOC = asciidoctor -ASCIIDOC_EXTRA = -a compat-mode -ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions -ASCIIDOC_EXTRA += -a mansource="libtraceevent" -a manmanual="libtraceevent Manual" -ASCIIDOC_HTML = xhtml5 -endif - -XMLTO=xmlto - -_tmp_tool_path := $(call get-executable,$(ASCIIDOC)) -ifeq ($(_tmp_tool_path),) - missing_tools = $(ASCIIDOC) -endif - -ifndef USE_ASCIIDOCTOR -_tmp_tool_path := $(call get-executable,$(XMLTO)) -ifeq ($(_tmp_tool_path),) - missing_tools += $(XMLTO) -endif -endif - -# -# For asciidoc ... -# -7.1.2, no extra settings are needed. -# 8.0-, set ASCIIDOC8. -# - -# -# For docbook-xsl ... -# -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0) -# 1.69.0, no extra settings are needed? -# 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? -# 1.71.1, no extra settings are needed? -# 1.72.0, set DOCBOOK_XSL_172. -# 1.73.0-, set ASCIIDOC_NO_ROFF -# - -# -# If you had been using DOCBOOK_XSL_172 in an attempt to get rid -# of 'the ".ft C" problem' in your generated manpages, and you -# instead ended up with weird characters around callouts, try -# using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8). -# - -ifdef ASCIIDOC8 -ASCIIDOC_EXTRA += -a asciidoc7compatible -endif -ifdef DOCBOOK_XSL_172 -ASCIIDOC_EXTRA += -a libtraceevent-asciidoc-no-roff -MANPAGE_XSL = manpage-1.72.xsl -else - ifdef ASCIIDOC_NO_ROFF - # docbook-xsl after 1.72 needs the regular XSL, but will not - # pass-thru raw roff codes from asciidoc.conf, so turn them off. - ASCIIDOC_EXTRA += -a libtraceevent-asciidoc-no-roff - endif -endif -ifdef MAN_BOLD_LITERAL -XMLTO_EXTRA += -m manpage-bold-literal.xsl -endif -ifdef DOCBOOK_SUPPRESS_SP -XMLTO_EXTRA += -m manpage-suppress-sp.xsl -endif - -SHELL_PATH ?= $(SHELL) -# Shell quote; -SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) - -DESTDIR ?= -DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' - -export DESTDIR DESTDIR_SQ - -# -# Please note that there is a minor bug in asciidoc. -# The version after 6.0.3 _will_ include the patch found here: -# http://marc.theaimsgroup.com/?l=libtraceevent&m=111558757202243&w=2 -# -# Until that version is released you may have to apply the patch -# yourself - yes, all 6 characters of it! -# -QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir -QUIET_SUBDIR1 = - -ifneq ($(findstring $(MAKEFLAGS),w),w) -PRINT_DIR = --no-print-directory -else # "make -w" -NO_SUBDIR = : -endif - -ifneq ($(findstring $(MAKEFLAGS),s),s) -ifneq ($(V),1) - QUIET_ASCIIDOC = @echo ' ASCIIDOC '$@; - QUIET_XMLTO = @echo ' XMLTO '$@; - QUIET_SUBDIR0 = +@subdir= - QUIET_SUBDIR1 = ;$(NO_SUBDIR) \ - echo ' SUBDIR ' $$subdir; \ - $(MAKE) $(PRINT_DIR) -C $$subdir - export V -endif -endif - -all: html man - -man: man3 -man3: $(DOC_MAN3) - -html: $(MAN_HTML) - -$(MAN_HTML) $(DOC_MAN3): asciidoc.conf - -install: install-man - -check-man-tools: -ifdef missing_tools - $(error "You need to install $(missing_tools) for man pages") -endif - -do-install-man: man - $(call QUIET_INSTALL, Documentation-man) \ - $(INSTALL) -d -m 755 $(DESTDIR)$(man3dir); \ - $(INSTALL) -m 644 $(DOC_MAN3) $(DESTDIR)$(man3dir); - -install-man: check-man-tools man do-install-man - -uninstall: uninstall-man - -uninstall-man: - $(call QUIET_UNINST, Documentation-man) \ - $(Q)$(RM) $(addprefix $(DESTDIR)$(man3dir)/,$(DOC_MAN3)) - - -ifdef missing_tools - DO_INSTALL_MAN = $(warning Please install $(missing_tools) to have the man pages installed) -else - DO_INSTALL_MAN = do-install-man -endif - -CLEAN_FILES = \ - $(MAN_XML) $(addsuffix +,$(MAN_XML)) \ - $(MAN_HTML) $(addsuffix +,$(MAN_HTML)) \ - $(DOC_MAN3) *.3 - -clean: - $(call QUIET_CLEAN, Documentation) $(RM) $(CLEAN_FILES) - -ifdef USE_ASCIIDOCTOR -$(OUTPUT)%.3 : $(OUTPUT)%.txt - $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ - $(ASCIIDOC) -b manpage -d manpage \ - $(ASCIIDOC_EXTRA) -alibtraceevent_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ - mv $@+ $@ -endif - -$(OUTPUT)%.3 : $(OUTPUT)%.xml - $(QUIET_XMLTO)$(RM) $@ && \ - $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< - -$(OUTPUT)%.xml : %.txt - $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ - $(ASCIIDOC) -b docbook -d manpage \ - $(ASCIIDOC_EXTRA) -alibtraceevent_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ - mv $@+ $@ - -$(MAN_HTML): $(OUTPUT)%.html : %.txt - $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ - $(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage \ - $(ASCIIDOC_EXTRA) -aperf_version=$(EVENT_PARSE_VERSION) -o $@+ $< && \ - mv $@+ $@tools/lib/traceevent/Documentation/asciidoc.conf deleted +0
-120@@ -1,120 +0,0 @@ -## linktep: macro -# -# Usage: linktep:command[manpage-section] -# -# Note, {0} is the manpage section, while {target} is the command. -# -# Show TEP link as: <command>(<section>); if section is defined, else just show -# the command. - -[macros] -(?su)[\\]?(?P<name>linktep):(?P<target>\S*?)\[(?P<attrlist>.*?)\]= - -[attributes] -asterisk=* -plus=+ -caret=^ -startsb=[ -endsb=] -tilde=~ - -ifdef::backend-docbook[] -[linktep-inlinemacro] -{0%{target}} -{0#<citerefentry>} -{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>} -{0#</citerefentry>} -endif::backend-docbook[] - -ifdef::backend-docbook[] -ifndef::tep-asciidoc-no-roff[] -# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this. -# v1.72 breaks with this because it replaces dots not in roff requests. -[listingblock] -<example><title>{title}</title> -<literallayout> -ifdef::doctype-manpage[] - .ft C -endif::doctype-manpage[] -| -ifdef::doctype-manpage[] - .ft -endif::doctype-manpage[] -</literallayout> -{title#}</example> -endif::tep-asciidoc-no-roff[] - -ifdef::tep-asciidoc-no-roff[] -ifdef::doctype-manpage[] -# The following two small workarounds insert a simple paragraph after screen -[listingblock] -<example><title>{title}</title> -<literallayout> -| -</literallayout><simpara></simpara> -{title#}</example> - -[verseblock] -<formalpara{id? id="{id}"}><title>{title}</title><para> -{title%}<literallayout{id? id="{id}"}> -{title#}<literallayout> -| -</literallayout> -{title#}</para></formalpara> -{title%}<simpara></simpara> -endif::doctype-manpage[] -endif::tep-asciidoc-no-roff[] -endif::backend-docbook[] - -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[header] -template::[header-declarations] -<refentry> -<refmeta> -<refentrytitle>{mantitle}</refentrytitle> -<manvolnum>{manvolnum}</manvolnum> -<refmiscinfo class="source">libtraceevent</refmiscinfo> -<refmiscinfo class="version">{libtraceevent_version}</refmiscinfo> -<refmiscinfo class="manual">libtraceevent Manual</refmiscinfo> -</refmeta> -<refnamediv> - <refname>{manname1}</refname> - <refname>{manname2}</refname> - <refname>{manname3}</refname> - <refname>{manname4}</refname> - <refname>{manname5}</refname> - <refname>{manname6}</refname> - <refname>{manname7}</refname> - <refname>{manname8}</refname> - <refname>{manname9}</refname> - <refname>{manname10}</refname> - <refname>{manname11}</refname> - <refname>{manname12}</refname> - <refname>{manname13}</refname> - <refname>{manname14}</refname> - <refname>{manname15}</refname> - <refname>{manname16}</refname> - <refname>{manname17}</refname> - <refname>{manname18}</refname> - <refname>{manname19}</refname> - <refname>{manname20}</refname> - <refname>{manname21}</refname> - <refname>{manname22}</refname> - <refname>{manname23}</refname> - <refname>{manname24}</refname> - <refname>{manname25}</refname> - <refname>{manname26}</refname> - <refname>{manname27}</refname> - <refname>{manname28}</refname> - <refname>{manname29}</refname> - <refname>{manname30}</refname> - <refpurpose>{manpurpose}</refpurpose> -</refnamediv> -endif::backend-docbook[] -endif::doctype-manpage[] - -ifdef::backend-xhtml11[] -[linktep-inlinemacro] -<a href="{target}.html">{target}{0?({0})}</a> -endif::backend-xhtml11[]tools/lib/traceevent/Documentation/libtraceevent-commands.txt deleted +0
-153@@ -1,153 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_register_comm, tep_override_comm, tep_pid_is_registered, -tep_data_comm_from_pid, tep_data_pid_from_comm, tep_cmdline_pid - -Manage pid to process name mappings. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_register_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_); -int *tep_override_comm*(struct tep_handle pass:[*]_tep_, const char pass:[*]_comm_, int _pid_); -bool *tep_is_pid_registered*(struct tep_handle pass:[*]_tep_, int _pid_); -const char pass:[*]*tep_data_comm_from_pid*(struct tep_handle pass:[*]_pevent_, int _pid_); -struct cmdline pass:[*]*tep_data_pid_from_comm*(struct tep_handle pass:[*]_pevent_, const char pass:[*]_comm_, struct cmdline pass:[*]_next_); -int *tep_cmdline_pid*(struct tep_handle pass:[*]_pevent_, struct cmdline pass:[*]_cmdline_); --- - -DESCRIPTION ------------ -These functions can be used to handle the mapping between pid and process name. -The library builds a cache of these mappings, which is used to display the name -of the process, instead of its pid. This information can be retrieved from -tracefs/saved_cmdlines file. - -The _tep_register_comm()_ function registers a _pid_ / process name mapping. -If a command with the same _pid_ is already registered, an error is returned. -The _pid_ argument is the process ID, the _comm_ argument is the process name, -_tep_ is the event context. The _comm_ is duplicated internally. - -The _tep_override_comm()_ function registers a _pid_ / process name mapping. -If a process with the same pid is already registered, the process name string is -udapted with the new one. The _pid_ argument is the process ID, the _comm_ -argument is the process name, _tep_ is the event context. The _comm_ is -duplicated internally. - -The _tep_is_pid_registered()_ function checks if a pid has a process name -mapping registered. The _pid_ argument is the process ID, _tep_ is the event -context. - -The _tep_data_comm_from_pid()_ function returns the process name for a given -pid. The _pid_ argument is the process ID, _tep_ is the event context. -The returned string should not be freed, but will be freed when the _tep_ -handler is closed. - -The _tep_data_pid_from_comm()_ function returns a pid for a given process name. -The _comm_ argument is the process name, _tep_ is the event context. -The argument _next_ is the cmdline structure to search for the next pid. -As there may be more than one pid for a given process, the result of this call -can be passed back into a recurring call in the _next_ parameter, to search for -the next pid. If _next_ is NULL, it will return the first pid associated with -the _comm_. The function performs a linear search, so it may be slow. - -The _tep_cmdline_pid()_ function returns the pid associated with a given -_cmdline_. The _tep_ argument is the event context. - -RETURN VALUE ------------- -_tep_register_comm()_ function returns 0 on success. In case of an error -1 is -returned and errno is set to indicate the cause of the problem: ENOMEM, if there -is not enough memory to duplicate the _comm_ or EEXIST if a mapping for this -_pid_ is already registered. - -_tep_override_comm()_ function returns 0 on success. In case of an error -1 is -returned and errno is set to indicate the cause of the problem: ENOMEM, if there -is not enough memory to duplicate the _comm_. - -_tep_is_pid_registered()_ function returns true if the _pid_ has a process name -mapped to it, false otherwise. - -_tep_data_comm_from_pid()_ function returns the process name as string, or the -string "<...>" if there is no mapping for the given pid. - -_tep_data_pid_from_comm()_ function returns a pointer to a struct cmdline, that -holds a pid for a given process, or NULL if none is found. This result can be -passed back into a recurring call as the _next_ parameter of the function. - -_tep_cmdline_pid()_ functions returns the pid for the give cmdline. If _cmdline_ - is NULL, then -1 is returned. - -EXAMPLE -------- -The following example registers pid for command "ls", in context of event _tep_ -and performs various searches for pid / process name mappings: -[source,c] --- -#include <event-parse.h> -... -int ret; -int ls_pid = 1021; -struct tep_handle *tep = tep_alloc(); -... - ret = tep_register_comm(tep, "ls", ls_pid); - if (ret != 0 && errno == EEXIST) - ret = tep_override_comm(tep, "ls", ls_pid); - if (ret != 0) { - /* Failed to register pid / command mapping */ - } -... - if (tep_is_pid_registered(tep, ls_pid) == 0) { - /* Command mapping for ls_pid is not registered */ - } -... - const char *comm = tep_data_comm_from_pid(tep, ls_pid); - if (comm) { - /* Found process name for ls_pid */ - } -... - int pid; - struct cmdline *cmd = tep_data_pid_from_comm(tep, "ls", NULL); - while (cmd) { - pid = tep_cmdline_pid(tep, cmd); - /* Found pid for process "ls" */ - cmd = tep_data_pid_from_comm(tep, "ls", cmd); - } --- -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-cpus.txt deleted +0
-77@@ -1,77 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_cpus, tep_set_cpus - Get / set the number of CPUs, which have a tracing -buffer representing it. Note, the buffer may be empty. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_get_cpus*(struct tep_handle pass:[*]_tep_); -void *tep_set_cpus*(struct tep_handle pass:[*]_tep_, int _cpus_); --- - -DESCRIPTION ------------ -The _tep_get_cpus()_ function gets the number of CPUs, which have a tracing -buffer representing it. The _tep_ argument is trace event parser context. - -The _tep_set_cpus()_ function sets the number of CPUs, which have a tracing -buffer representing it. The _tep_ argument is trace event parser context. -The _cpu_ argument is the number of CPUs with tracing data. - -RETURN VALUE ------------- -The _tep_get_cpus()_ functions returns the number of CPUs, which have tracing -data recorded. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... - tep_set_cpus(tep, 5); -... - printf("We have tracing data for %d CPUs", tep_get_cpus(tep)); --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-endian_read.txt deleted +0
-78@@ -1,78 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_read_number - Reads a number from raw data. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -unsigned long long *tep_read_number*(struct tep_handle pass:[*]_tep_, const void pass:[*]_ptr_, int _size_); --- - -DESCRIPTION ------------ -The _tep_read_number()_ function reads an integer from raw data, taking into -account the endianness of the raw data and the current host. The _tep_ argument -is the trace event parser context. The _ptr_ is a pointer to the raw data, where -the integer is, and the _size_ is the size of the integer. - -RETURN VALUE ------------- -The _tep_read_number()_ function returns the integer in the byte order of -the current host. In case of an error, 0 is returned. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -void process_record(struct tep_record *record) -{ - int offset = 24; - int data = tep_read_number(tep, record->data + offset, 4); - - /* Read the 4 bytes at the offset 24 of data as an integer */ -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-event_find.txt deleted +0
-103@@ -1,103 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_find_event,tep_find_event_by_name,tep_find_event_by_record - -Find events by given key. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_); -struct tep_event pass:[*]*tep_find_event_by_name*(struct tep_handle pass:[*]_tep_, const char pass:[*]_sys_, const char pass:[*]_name_); -struct tep_event pass:[*]*tep_find_event_by_record*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_record_); --- - -DESCRIPTION ------------ -This set of functions can be used to search for an event, based on a given -criteria. All functions require a pointer to a _tep_, trace event parser -context. - -The _tep_find_event()_ function searches for an event by given event _id_. The -event ID is assigned dynamically and can be viewed in event's format file, -"ID" field. - -The tep_find_event_by_name()_ function searches for an event by given -event _name_, under the system _sys_. If the _sys_ is NULL (not specified), -the first event with _name_ is returned. - -The tep_find_event_by_record()_ function searches for an event from a given -_record_. - -RETURN VALUE ------------- -All these functions return a pointer to the found event, or NULL if there is no -such event. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -struct tep_event *event; - -event = tep_find_event(tep, 1857); -if (event == NULL) { - /* There is no event with ID 1857 */ -} - -event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); -if (event == NULL) { - /* There is no kvm_exit event, from kvm system */ -} - -void event_from_record(struct tep_record *record) -{ - struct tep_event *event = tep_find_event_by_record(tep, record); - if (event == NULL) { - /* There is no event from given record */ - } -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-event_get.txt deleted +0
-99@@ -1,99 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_event, tep_get_first_event, tep_get_events_count - Access events. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_event pass:[*]*tep_get_event*(struct tep_handle pass:[*]_tep_, int _index_); -struct tep_event pass:[*]*tep_get_first_event*(struct tep_handle pass:[*]_tep_); -int *tep_get_events_count*(struct tep_handle pass:[*]_tep_); --- - -DESCRIPTION ------------ -The _tep_get_event()_ function returns a pointer to event at the given _index_. -The _tep_ argument is trace event parser context, the _index_ is the index of -the requested event. - -The _tep_get_first_event()_ function returns a pointer to the first event. -As events are stored in an array, this function returns the pointer to the -beginning of the array. The _tep_ argument is trace event parser context. - -The _tep_get_events_count()_ function returns the number of the events -in the array. The _tep_ argument is trace event parser context. - -RETURN VALUE ------------- -The _tep_get_event()_ returns a pointer to the event located at _index_. -NULL is returned in case of error, in case there are no events or _index_ is -out of range. - -The _tep_get_first_event()_ returns a pointer to the first event. NULL is -returned in case of error, or in case there are no events. - -The _tep_get_events_count()_ returns the number of the events. 0 is -returned in case of error, or in case there are no events. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -int i,count = tep_get_events_count(tep); -struct tep_event *event, *events = tep_get_first_event(tep); - -if (events == NULL) { - /* There are no events */ -} else { - for (i = 0; i < count; i++) { - event = (events+i); - /* process events[i] */ - } - - /* Get the last event */ - event = tep_get_event(tep, count-1); -} --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-event_list.txt deleted +0
-122@@ -1,122 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_list_events, tep_list_events_copy - -Get list of events, sorted by given criteria. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -enum *tep_event_sort_type* { - _TEP_EVENT_SORT_ID_, - _TEP_EVENT_SORT_NAME_, - _TEP_EVENT_SORT_SYSTEM_, -}; - -struct tep_event pass:[*]pass:[*]*tep_list_events*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_); -struct tep_event pass:[*]pass:[*]*tep_list_events_copy*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_); --- - -DESCRIPTION ------------ -The _tep_list_events()_ function returns an array of pointers to the events, -sorted by the _sort_type_ criteria. The last element of the array is NULL. -The returned memory must not be freed, it is managed by the library. -The function is not thread safe. The _tep_ argument is trace event parser -context. The _sort_type_ argument is the required sort criteria: -[verse] --- - _TEP_EVENT_SORT_ID_ - sort by the event ID. - _TEP_EVENT_SORT_NAME_ - sort by the event (name, system, id) triplet. - _TEP_EVENT_SORT_SYSTEM_ - sort by the event (system, name, id) triplet. --- - -The _tep_list_events_copy()_ is a thread safe version of _tep_list_events()_. -It has the same behavior, but the returned array is allocated internally and -must be freed by the caller. Note that the content of the array must not be -freed (see the EXAMPLE below). - -RETURN VALUE ------------- -The _tep_list_events()_ function returns an array of pointers to events. -In case of an error, NULL is returned. The returned array must not be freed, -it is managed by the library. - -The _tep_list_events_copy()_ function returns an array of pointers to events. -In case of an error, NULL is returned. The returned array must be freed by -the caller. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -int i; -struct tep_event_format **events; - -i=0; -events = tep_list_events(tep, TEP_EVENT_SORT_ID); -if (events == NULL) { - /* Failed to get the events, sorted by ID */ -} else { - while(events[i]) { - /* walk through the list of the events, sorted by ID */ - i++; - } -} - -i=0; -events = tep_list_events_copy(tep, TEP_EVENT_SORT_NAME); -if (events == NULL) { - /* Failed to get the events, sorted by name */ -} else { - while(events[i]) { - /* walk through the list of the events, sorted by name */ - i++; - } - free(events); -} - -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-event_print.txt deleted +0
-130@@ -1,130 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_print_event - Writes event information into a trace sequence. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* -*#include <trace-seq.h>* - -void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seqpass:[*]_s_, struct tep_record pass:[*]_record_, const char pass:[*]_fmt_, _..._) --- - -DESCRIPTION ------------ - -The _tep_print_event()_ function parses the event information of the given -_record_ and writes it into the trace sequence _s_, according to the format -string _fmt_. The desired information is specified after the format string. -The _fmt_ is printf-like format string, following arguments are supported: -[verse] --- - TEP_PRINT_PID, "%d" - PID of the event. - TEP_PRINT_CPU, "%d" - Event CPU. - TEP_PRINT_COMM, "%s" - Event command string. - TEP_PRINT_NAME, "%s" - Event name. - TEP_PRINT_LATENCY, "%s" - Latency of the event. It prints 4 or more - fields - interrupt state, scheduling state, - current context, and preemption count. - Field 1 is the interrupt enabled state: - d : Interrupts are disabled - . : Interrupts are enabled - X : The architecture does not support this - information - Field 2 is the "need resched" state. - N : The task is set to call the scheduler when - possible, as another higher priority task - may need to be scheduled in. - . : The task is not set to call the scheduler. - Field 3 is the context state. - . : Normal context - s : Soft interrupt context - h : Hard interrupt context - H : Hard interrupt context which triggered - during soft interrupt context. - z : NMI context - Z : NMI context which triggered during hard - interrupt context - Field 4 is the preemption count. - . : The preempt count is zero. - On preemptible kernels (where the task can be scheduled - out in arbitrary locations while in kernel context), the - preempt count, when non zero, will prevent the kernel - from scheduling out the current task. The preempt count - number is displayed when it is not zero. - Depending on the kernel, it may show other fields - (lock depth, or migration disabled, which are unique to - specialized kernels). - TEP_PRINT_TIME, %d - event time stamp. A divisor and precision can be - specified as part of this format string: - "%precision.divisord". Example: - "%3.1000d" - divide the time by 1000 and print the first - 3 digits before the dot. Thus, the time stamp - "123456000" will be printed as "123.456" - TEP_PRINT_INFO, "%s" - event information. - TEP_PRINT_INFO_RAW, "%s" - event information, in raw format. - --- -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -#include <trace-seq.h> -... -struct trace_seq seq; -trace_seq_init(&seq); -struct tep_handle *tep = tep_alloc(); -... -void print_my_event(struct tep_record *record) -{ - trace_seq_reset(&seq); - tep_print_event(tep, s, record, "%16s-%-5d [%03d] %s %6.1000d %s %s", - TEP_PRINT_COMM, TEP_PRINT_PID, TEP_PRINT_CPU, - TEP_PRINT_LATENCY, TEP_PRINT_TIME, TEP_PRINT_NAME, - TEP_PRINT_INFO); -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*trace-seq.h* - Header file to include in order to have access to trace sequences related APIs. - Trace sequences are used to allow a function to call several other functions - to create a string of data to use. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-field_find.txt deleted +0
-118@@ -1,118 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_find_common_field, tep_find_field, tep_find_any_field - -Search for a field in an event. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_format_field pass:[*]*tep_find_common_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_); -struct tep_format_field pass:[*]*tep_find_field*(struct tep_event_ormat pass:[*]_event_, const char pass:[*]_name_); -struct tep_format_field pass:[*]*tep_find_any_field*(struct tep_event pass:[*]_event_, const char pass:[*]_name_); --- - -DESCRIPTION ------------ -These functions search for a field with given name in an event. The field -returned can be used to find the field content from within a data record. - -The _tep_find_common_field()_ function searches for a common field with _name_ -in the _event_. - -The _tep_find_field()_ function searches for an event specific field with -_name_ in the _event_. - -The _tep_find_any_field()_ function searches for any field with _name_ in the -_event_. - -RETURN VALUE ------------- -The _tep_find_common_field(), _tep_find_field()_ and _tep_find_any_field()_ -functions return a pointer to the found field, or NULL in case there is no field -with the requested name. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -void get_htimer_info(struct tep_handle *tep, struct tep_record *record) -{ - struct tep_format_field *field; - struct tep_event *event; - long long softexpires; - int mode; - int pid; - - event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); - - field = tep_find_common_field(event, "common_pid"); - if (field == NULL) { - /* Cannot find "common_pid" field in the event */ - } else { - /* Get pid from the data record */ - pid = tep_read_number(tep, record->data + field->offset, - field->size); - } - - field = tep_find_field(event, "softexpires"); - if (field == NULL) { - /* Cannot find "softexpires" event specific field in the event */ - } else { - /* Get softexpires parameter from the data record */ - softexpires = tep_read_number(tep, record->data + field->offset, - field->size); - } - - field = tep_find_any_field(event, "mode"); - if (field == NULL) { - /* Cannot find "mode" field in the event */ - } else - { - /* Get mode parameter from the data record */ - mode = tep_read_number(tep, record->data + field->offset, - field->size); - } -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt deleted +0
-122@@ -1,122 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_any_field_val, tep_get_common_field_val, tep_get_field_val, -tep_get_field_raw - Get value of a field. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* -*#include <trace-seq.h>* - -int *tep_get_any_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); -int *tep_get_common_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); -int *tep_get_field_val*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, unsigned long long pass:[*]_val_, int _err_); -void pass:[*]*tep_get_field_raw*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int pass:[*]_len_, int _err_); --- - -DESCRIPTION ------------ -These functions can be used to find a field and retrieve its value. - -The _tep_get_any_field_val()_ function searches in the _record_ for a field -with _name_, part of the _event_. If the field is found, its value is stored in -_val_. If there is an error and _err_ is not zero, then an error string is -written into _s_. - -The _tep_get_common_field_val()_ function does the same as -_tep_get_any_field_val()_, but searches only in the common fields. This works -for any event as all events include the common fields. - -The _tep_get_field_val()_ function does the same as _tep_get_any_field_val()_, -but searches only in the event specific fields. - -The _tep_get_field_raw()_ function searches in the _record_ for a field with -_name_, part of the _event_. If the field is found, a pointer to where the field -exists in the record's raw data is returned. The size of the data is stored in -_len_. If there is an error and _err_ is not zero, then an error string is -written into _s_. - -RETURN VALUE ------------- -The _tep_get_any_field_val()_, _tep_get_common_field_val()_ and -_tep_get_field_val()_ functions return 0 on success, or -1 in case of an error. - -The _tep_get_field_raw()_ function returns a pointer to field's raw data, and -places the length of this data in _len_. In case of an error NULL is returned. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -#include <trace-seq.h> -... -struct tep_handle *tep = tep_alloc(); -... -struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); -... -void process_record(struct tep_record *record) -{ - int len; - char *comm; - struct tep_event_format *event; - unsigned long long val; - - event = tep_find_event_by_record(pevent, record); - if (event != NULL) { - if (tep_get_common_field_val(NULL, event, "common_type", - record, &val, 0) == 0) { - /* Got the value of common type field */ - } - if (tep_get_field_val(NULL, event, "pid", record, &val, 0) == 0) { - /* Got the value of pid specific field */ - } - comm = tep_get_field_raw(NULL, event, "comm", record, &len, 0); - if (comm != NULL) { - /* Got a pointer to the comm event specific field */ - } - } -} --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*trace-seq.h* - Header file to include in order to have access to trace sequences - related APIs. Trace sequences are used to allow a function to call - several other functions to create a string of data to use. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-field_print.txt deleted +0
-126@@ -1,126 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_print_field, tep_print_fields, tep_print_num_field, tep_print_func_field - -Print the field content. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* -*#include <trace-seq.h>* - -void *tep_print_field*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, struct tep_format_field pass:[*]_field_); -void *tep_print_fields*(struct trace_seq pass:[*]_s_, void pass:[*]_data_, int _size_, struct tep_event pass:[*]_event_); -int *tep_print_num_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); -int *tep_print_func_field*(struct trace_seq pass:[*]_s_, const char pass:[*]_fmt_, struct tep_event pass:[*]_event_, const char pass:[*]_name_, struct tep_record pass:[*]_record_, int _err_); --- - -DESCRIPTION ------------ -These functions print recorded field's data, according to the field's type. - -The _tep_print_field()_ function extracts from the recorded raw _data_ value of -the _field_ and prints it into _s_, according to the field type. - -The _tep_print_fields()_ prints each field name followed by the record's field -value according to the field's type: -[verse] --- -"field1_name=field1_value field2_name=field2_value ..." --- -It iterates all fields of the _event_, and calls _tep_print_field()_ for each of -them. - -The _tep_print_num_field()_ function prints a numeric field with given format -string. A search is performed in the _event_ for a field with _name_. If such -field is found, its value is extracted from the _record_ and is printed in the -_s_, according to the given format string _fmt_. If the argument _err_ is -non-zero, and an error occures - it is printed in the _s_. - -The _tep_print_func_field()_ function prints a function field with given format -string. A search is performed in the _event_ for a field with _name_. If such -field is found, its value is extracted from the _record_. The value is assumed -to be a function address, and a search is perform to find the name of this -function. The function name (if found) and its address are printed in the _s_, -according to the given format string _fmt_. If the argument _err_ is non-zero, -and an error occures - it is printed in _s_. - -RETURN VALUE ------------- -The _tep_print_num_field()_ and _tep_print_func_field()_ functions return 1 -on success, -1 in case of an error or 0 if the print buffer _s_ is full. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -#include <trace-seq.h> -... -struct tep_handle *tep = tep_alloc(); -... -struct trace_seq seq; -trace_seq_init(&seq); -struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); -... -void process_record(struct tep_record *record) -{ - struct tep_format_field *field_pid = tep_find_common_field(event, "common_pid"); - - trace_seq_reset(&seq); - - /* Print the value of "common_pid" */ - tep_print_field(&seq, record->data, field_pid); - - /* Print all fields of the "hrtimer_start" event */ - tep_print_fields(&seq, record->data, record->size, event); - - /* Print the value of "expires" field with custom format string */ - tep_print_num_field(&seq, " timer expires in %llu ", event, "expires", record, 0); - - /* Print the address and the name of "function" field with custom format string */ - tep_print_func_field(&seq, " timer function is %s ", event, "function", record, 0); - } - ... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*trace-seq.h* - Header file to include in order to have access to trace sequences related APIs. - Trace sequences are used to allow a function to call several other functions - to create a string of data to use. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-field_read.txt deleted +0
-81@@ -1,81 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_read_number_field - Reads a number from raw data. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_read_number_field*(struct tep_format_field pass:[*]_field_, const void pass:[*]_data_, unsigned long long pass:[*]_value_); --- - -DESCRIPTION ------------ -The _tep_read_number_field()_ function reads the value of the _field_ from the -raw _data_ and stores it in the _value_. The function sets the _value_ according -to the endianness of the raw data and the current machine and stores it in -_value_. - -RETURN VALUE ------------- -The _tep_read_number_field()_ function retunrs 0 in case of success, or -1 in -case of an error. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -struct tep_event *event = tep_find_event_by_name(tep, "timer", "hrtimer_start"); -... -void process_record(struct tep_record *record) -{ - unsigned long long pid; - struct tep_format_field *field_pid = tep_find_common_field(event, "common_pid"); - - if (tep_read_number_field(field_pid, record->data, &pid) != 0) { - /* Failed to get "common_pid" value */ - } -} -... --- -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-fields.txt deleted +0
-105@@ -1,105 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_event_common_fields, tep_event_fields - Get a list of fields for an event. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_format_field pass:[*]pass:[*]*tep_event_common_fields*(struct tep_event pass:[*]_event_); -struct tep_format_field pass:[*]pass:[*]*tep_event_fields*(struct tep_event pass:[*]_event_); --- - -DESCRIPTION ------------ -The _tep_event_common_fields()_ function returns an array of pointers to common -fields for the _event_. The array is allocated in the function and must be freed -by free(). The last element of the array is NULL. - -The _tep_event_fields()_ function returns an array of pointers to event specific -fields for the _event_. The array is allocated in the function and must be freed -by free(). The last element of the array is NULL. - -RETURN VALUE ------------- -Both _tep_event_common_fields()_ and _tep_event_fields()_ functions return -an array of pointers to tep_format_field structures in case of success, or -NULL in case of an error. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -int i; -struct tep_format_field **fields; -struct tep_event *event = tep_find_event_by_name(tep, "kvm", "kvm_exit"); -if (event != NULL) { - fields = tep_event_common_fields(event); - if (fields != NULL) { - i = 0; - while (fields[i]) { - /* - walk through the list of the common fields - of the kvm_exit event - */ - i++; - } - free(fields); - } - fields = tep_event_fields(event); - if (fields != NULL) { - i = 0; - while (fields[i]) { - /* - walk through the list of the event specific - fields of the kvm_exit event - */ - i++; - } - free(fields); - } -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-file_endian.txt deleted +0
-91@@ -1,91 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_is_file_bigendian, tep_set_file_bigendian - Get / set the endianness of the -raw data being accessed by the tep handler. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -enum *tep_endian* { - TEP_LITTLE_ENDIAN = 0, - TEP_BIG_ENDIAN -}; - -bool *tep_is_file_bigendian*(struct tep_handle pass:[*]_tep_); -void *tep_set_file_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); - --- -DESCRIPTION ------------ -The _tep_is_file_bigendian()_ function gets the endianness of the raw data, -being accessed by the tep handler. The _tep_ argument is trace event parser -context. - -The _tep_set_file_bigendian()_ function sets the endianness of raw data being -accessed by the tep handler. The _tep_ argument is trace event parser context. -[verse] --- -The _endian_ argument is the endianness: - _TEP_LITTLE_ENDIAN_ - the raw data is in little endian format, - _TEP_BIG_ENDIAN_ - the raw data is in big endian format. --- -RETURN VALUE ------------- -The _tep_is_file_bigendian()_ function returns true if the data is in bigendian -format, false otherwise. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... - tep_set_file_bigendian(tep, TEP_LITTLE_ENDIAN); -... - if (tep_is_file_bigendian(tep)) { - /* The raw data is in big endian */ - } else { - /* The raw data is in little endian */ - } --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-filter.txt deleted +0
-209@@ -1,209 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_filter_alloc, tep_filter_free, tep_filter_reset, tep_filter_make_string, -tep_filter_copy, tep_filter_compare, tep_filter_match, tep_event_filtered, -tep_filter_remove_event, tep_filter_strerror, tep_filter_add_filter_str - -Event filter related APIs. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_event_filter pass:[*]*tep_filter_alloc*(struct tep_handle pass:[*]_tep_); -void *tep_filter_free*(struct tep_event_filter pass:[*]_filter_); -void *tep_filter_reset*(struct tep_event_filter pass:[*]_filter_); -enum tep_errno *tep_filter_add_filter_str*(struct tep_event_filter pass:[*]_filter_, const char pass:[*]_filter_str_); -int *tep_event_filtered*(struct tep_event_filter pass:[*]_filter_, int _event_id_); -int *tep_filter_remove_event*(struct tep_event_filter pass:[*]_filter_, int _event_id_); -enum tep_errno *tep_filter_match*(struct tep_event_filter pass:[*]_filter_, struct tep_record pass:[*]_record_); -int *tep_filter_copy*(struct tep_event_filter pass:[*]_dest_, struct tep_event_filter pass:[*]_source_); -int *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_); -char pass:[*]*tep_filter_make_string*(struct tep_event_filter pass:[*]_filter_, int _event_id_); -int *tep_filter_strerror*(struct tep_event_filter pass:[*]_filter_, enum tep_errno _err_, char pass:[*]buf, size_t _buflen_); --- - -DESCRIPTION ------------ -Filters can be attached to traced events. They can be used to filter out various -events when outputting them. Each event can be filtered based on its parameters, -described in the event's format file. This set of functions can be used to -create, delete, modify and attach event filters. - -The _tep_filter_alloc()_ function creates a new event filter. The _tep_ argument -is the trace event parser context. - -The _tep_filter_free()_ function frees an event filter and all resources that it -had used. - -The _tep_filter_reset()_ function removes all rules from an event filter and -resets it. - -The _tep_filter_add_filter_str()_ function adds a new rule to the _filter_. The -_filter_str_ argument is the filter string, that contains the rule. - -The _tep_event_filtered()_ function checks if the event with _event_id_ has -_filter_. - -The _tep_filter_remove_event()_ function removes a _filter_ for an event with -_event_id_. - -The _tep_filter_match()_ function tests if a _record_ matches given _filter_. - -The _tep_filter_copy()_ function copies a _source_ filter into a _dest_ filter. - -The _tep_filter_compare()_ function compares two filers - _filter1_ and _filter2_. - -The _tep_filter_make_string()_ function constructs a string, displaying -the _filter_ contents for given _event_id_. - -The _tep_filter_strerror()_ function copies the _filter_ error buffer into the -given _buf_ with the size _buflen_. If the error buffer is empty, in the _buf_ -is copied a string, describing the error _err_. - -RETURN VALUE ------------- -The _tep_filter_alloc()_ function returns a pointer to the newly created event -filter, or NULL in case of an error. - -The _tep_filter_add_filter_str()_ function returns 0 if the rule was -successfully added or a negative error code. Use _tep_filter_strerror()_ to see -actual error message in case of an error. - -The _tep_event_filtered()_ function returns 1 if the filter is found for given -event, or 0 otherwise. - -The _tep_filter_remove_event()_ function returns 1 if the vent was removed, or -0 if the event was not found. - -The _tep_filter_match()_ function returns _tep_errno_, according to the result: -[verse] --- -_pass:[TEP_ERRNO__FILTER_MATCH]_ - filter found for event, the record matches. -_pass:[TEP_ERRNO__FILTER_MISS]_ - filter found for event, the record does not match. -_pass:[TEP_ERRNO__FILTER_NOT_FOUND]_ - no filter found for record's event. -_pass:[TEP_ERRNO__NO_FILTER]_ - no rules in the filter. --- -or any other _tep_errno_, if an error occurred during the test. - -The _tep_filter_copy()_ function returns 0 on success or -1 if not all rules - were copied. - -The _tep_filter_compare()_ function returns 1 if the two filters hold the same -content, or 0 if they do not. - -The _tep_filter_make_string()_ function returns a string, which must be freed -with free(), or NULL in case of an error. - -The _tep_filter_strerror()_ function returns 0 if message was filled -successfully, or -1 in case of an error. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -char errstr[200]; -int ret; - -struct tep_event_filter *filter = tep_filter_alloc(tep); -struct tep_event_filter *filter1 = tep_filter_alloc(tep); -ret = tep_filter_add_filter_str(filter, "sched/sched_wakeup:target_cpu==1"); -if(ret < 0) { - tep_filter_strerror(filter, ret, errstr, sizeof(errstr)); - /* Failed to add a new rule to the filter, the error string is in errstr */ -} -if (tep_filter_copy(filter1, filter) != 0) { - /* Failed to copy filter in filter1 */ -} -... -if (tep_filter_compare(filter, filter1) != 1) { - /* Both filters are different */ -} -... -void process_record(struct tep_handle *tep, struct tep_record *record) -{ - struct tep_event *event; - char *fstring; - - event = tep_find_event_by_record(tep, record); - - if (tep_event_filtered(filter, event->id) == 1) { - /* The event has filter */ - fstring = tep_filter_make_string(filter, event->id); - if (fstring != NULL) { - /* The filter for the event is in fstring */ - free(fstring); - } - } - - switch (tep_filter_match(filter, record)) { - case TEP_ERRNO__FILTER_MATCH: - /* The filter matches the record */ - break; - case TEP_ERRNO__FILTER_MISS: - /* The filter does not match the record */ - break; - case TEP_ERRNO__FILTER_NOT_FOUND: - /* No filter found for record's event */ - break; - case TEP_ERRNO__NO_FILTER: - /* There are no rules in the filter */ - break - default: - /* An error occurred during the test */ - break; - } - - if (tep_filter_remove_event(filter, event->id) == 1) { - /* The event was removed from the filter */ - } -} - -... -tep_filter_reset(filter); -... -tep_filter_free(filter); -tep_filter_free(filter1); -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-func_apis.txt deleted +0
-183@@ -1,183 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_find_function, tep_find_function_address, tep_set_function_resolver, -tep_reset_function_resolver, tep_register_function, tep_register_print_string - -function related tep APIs - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -typedef char pass:[*](*tep_func_resolver_t*)(void pass:[*]_priv_, unsigned long long pass:[*]_addrp_, char pass:[**]_modp_); -int *tep_set_function_resolver*(struct tep_handle pass:[*]_tep_, tep_func_resolver_t pass:[*]_func_, void pass:[*]_priv_); -void *tep_reset_function_resolver*(struct tep_handle pass:[*]_tep_); -const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); -unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); -int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_); -int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_); --- - -DESCRIPTION ------------ -Some tools may have already a way to resolve the kernel functions. These APIs -allow them to keep using it instead of duplicating all the entries inside. - -The _tep_func_resolver_t_ type is the prototype of the alternative kernel -functions resolver. This function receives a pointer to its custom context -(set with the _tep_set_function_resolver()_ call ) and the address of a kernel -function, which has to be resolved. In case of success, it should return -the name of the function and its module (if any) in _modp_. - -The _tep_set_function_resolver()_ function registers _func_ as an alternative -kernel functions resolver. The _tep_ argument is trace event parser context. -The _priv_ argument is a custom context of the _func_ function. The function -resolver is used by the APIs _tep_find_function()_, -_tep_find_function_address()_, and _tep_print_func_field()_ to resolve -a function address to a function name. - -The _tep_reset_function_resolver()_ function resets the kernel functions -resolver to the default function. The _tep_ argument is trace event parser -context. - - -These APIs can be used to find function name and start address, by given -address. The given address does not have to be exact, it will select -the function that would contain it. - -The _tep_find_function()_ function returns the function name, which contains the -given address _addr_. The _tep_ argument is the trace event parser context. - -The _tep_find_function_address()_ function returns the function start address, -by given address _addr_. The _addr_ does not have to be exact, it will select -the function that would contain it. The _tep_ argument is the trace event -parser context. - -The _tep_register_function()_ function registers a function name mapped to an -address and (optional) module. This mapping is used in case the function tracer -or events have "%pS" parameter in its format string. It is common to pass in -the kallsyms function names with their corresponding addresses with this -function. The _tep_ argument is the trace event parser context. The _name_ is -the name of the function, the string is copied internally. The _addr_ is the -start address of the function. The _mod_ is the kernel module the function may -be in (NULL for none). - -The _tep_register_print_string()_ function registers a string by the address -it was stored in the kernel. Some strings internal to the kernel with static -address are passed to certain events. The "%s" in the event's format field -which has an address needs to know what string would be at that address. The -tep_register_print_string() supplies the parsing with the mapping between kernel -addresses and those strings. The _tep_ argument is the trace event parser -context. The _fmt_ is the string to register, it is copied internally. -The _addr_ is the address the string was located at. - - -RETURN VALUE ------------- -The _tep_set_function_resolver()_ function returns 0 in case of success, or -1 -in case of an error. - -The _tep_find_function()_ function returns the function name, or NULL in case -it cannot be found. - -The _tep_find_function_address()_ function returns the function start address, -or 0 in case it cannot be found. - -The _tep_register_function()_ function returns 0 in case of success. In case of -an error -1 is returned, and errno is set to the appropriate error number. - -The _tep_register_print_string()_ function returns 0 in case of success. In case -of an error -1 is returned, and errno is set to the appropriate error number. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -char *my_resolve_kernel_addr(void *context, - unsigned long long *addrp, char **modp) -{ - struct db *function_database = context; - struct symbol *sym = sql_lookup(function_database, *addrp); - - if (!sym) - return NULL; - - *modp = sym->module_name; - return sym->name; -} - -void show_function( unsigned long long addr) -{ - unsigned long long fstart; - const char *fname; - - if (tep_set_function_resolver(tep, my_resolve_kernel_addr, - function_database) != 0) { - /* failed to register my_resolve_kernel_addr */ - } - - /* These APIs use my_resolve_kernel_addr() to resolve the addr */ - fname = tep_find_function(tep, addr); - fstart = tep_find_function_address(tep, addr); - - /* - addr is in function named fname, starting at fstart address, - at offset (addr - fstart) - */ - - tep_reset_function_resolver(tep); - -} -... - if (tep_register_function(tep, "kvm_exit", - (unsigned long long) 0x12345678, "kvm") != 0) { - /* Failed to register kvm_exit address mapping */ - } -... - if (tep_register_print_string(tep, "print string", - (unsigned long long) 0x87654321, NULL) != 0) { - /* Failed to register "print string" address mapping */ - } -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-func_find.txt deleted +0
-88@@ -1,88 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_find_function,tep_find_function_address - Find function name / start address. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); -unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_); --- - -DESCRIPTION ------------ -These functions can be used to find function name and start address, by given -address. The given address does not have to be exact, it will select the function -that would contain it. - -The _tep_find_function()_ function returns the function name, which contains the -given address _addr_. The _tep_ argument is the trace event parser context. - -The _tep_find_function_address()_ function returns the function start address, -by given address _addr_. The _addr_ does not have to be exact, it will select the -function that would contain it. The _tep_ argument is the trace event parser context. - -RETURN VALUE ------------- -The _tep_find_function()_ function returns the function name, or NULL in case -it cannot be found. - -The _tep_find_function_address()_ function returns the function start address, -or 0 in case it cannot be found. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -void show_function( unsigned long long addr) -{ - const char *fname = tep_find_function(tep, addr); - unsigned long long fstart = tep_find_function_address(tep, addr); - - /* addr is in function named fname, starting at fstart address, at offset (addr - fstart) */ -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-handle.txt deleted +0
-101@@ -1,101 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_alloc, tep_free,tep_ref, tep_unref,tep_get_ref - Create, destroy, manage -references of trace event parser context. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_handle pass:[*]*tep_alloc*(void); -void *tep_free*(struct tep_handle pass:[*]_tep_); -void *tep_ref*(struct tep_handle pass:[*]_tep_); -void *tep_unref*(struct tep_handle pass:[*]_tep_); -int *tep_get_ref*(struct tep_handle pass:[*]_tep_); --- - -DESCRIPTION ------------ -These are the main functions to create and destroy tep_handle - the main -structure, representing the trace event parser context. This context is used as -the input parameter of most library APIs. - -The _tep_alloc()_ function allocates and initializes the tep context. - -The _tep_free()_ function will decrement the reference of the _tep_ handler. -When there is no more references, then it will free the handler, as well -as clean up all its resources that it had used. The argument _tep_ is -the pointer to the trace event parser context. - -The _tep_ref()_ function adds a reference to the _tep_ handler. - -The _tep_unref()_ function removes a reference from the _tep_ handler. When -the last reference is removed, the _tep_ is destroyed, and all resources that -it had used are cleaned up. - -The _tep_ref_get()_ functions gets the current references of the _tep_ handler. - -RETURN VALUE ------------- -_tep_alloc()_ returns a pointer to a newly created tep_handle structure. -NULL is returned in case there is not enough free memory to allocate it. - -_tep_ref_get()_ returns the current references of _tep_. -If _tep_ is NULL, 0 is returned. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> - -... -struct tep_handle *tep = tep_alloc(); -... -int ref = tep_get_ref(tep); -tep_ref(tep); -if ( (ref+1) != tep_get_ref(tep)) { - /* Something wrong happened, the counter is not incremented by 1 */ -} -tep_unref(tep); -... -tep_free(tep); -... --- -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-header_page.txt deleted +0
-102@@ -1,102 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_header_page_size, tep_get_header_timestamp_size, tep_is_old_format - -Get the data stored in the header page, in kernel context. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_); -int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_); -bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_); --- -DESCRIPTION ------------ -These functions retrieve information from kernel context, stored in tracefs -events/header_page. Old kernels do not have header page info, so default values -from user space context are used. - -The _tep_get_header_page_size()_ function returns the size of a long integer, -in kernel context. The _tep_ argument is trace event parser context. -This information is retrieved from tracefs events/header_page, "commit" field. - -The _tep_get_header_timestamp_size()_ function returns the size of timestamps, -in kernel context. The _tep_ argument is trace event parser context. This -information is retrieved from tracefs events/header_page, "timestamp" field. - -The _tep_is_old_format()_ function returns true if the kernel predates -the addition of events/header_page, otherwise it returns false. - -RETURN VALUE ------------- -The _tep_get_header_page_size()_ function returns the size of a long integer, -in bytes. - -The _tep_get_header_timestamp_size()_ function returns the size of timestamps, -in bytes. - -The _tep_is_old_format()_ function returns true, if an old kernel is used to -generate the tracing data, which has no event/header_page. If the kernel is new, -or _tep_ is NULL, false is returned. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... - int longsize; - int timesize; - bool old; - - longsize = tep_get_header_page_size(tep); - timesize = tep_get_header_timestamp_size(tep); - old = tep_is_old_format(tep); - - printf ("%s kernel is used to generate the tracing data.\n", - old?"Old":"New"); - printf("The size of a long integer is %d bytes.\n", longsize); - printf("The timestamps size is %d bytes.\n", timesize); -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-host_endian.txt deleted +0
-104@@ -1,104 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_is_bigendian, tep_is_local_bigendian, tep_set_local_bigendian - Get / set -the endianness of the local machine. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -enum *tep_endian* { - TEP_LITTLE_ENDIAN = 0, - TEP_BIG_ENDIAN -}; - -int *tep_is_bigendian*(void); -bool *tep_is_local_bigendian*(struct tep_handle pass:[*]_tep_); -void *tep_set_local_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_); --- - -DESCRIPTION ------------ - -The _tep_is_bigendian()_ gets the endianness of the machine, executing -the function. - -The _tep_is_local_bigendian()_ function gets the endianness of the local -machine, saved in the _tep_ handler. The _tep_ argument is the trace event -parser context. This API is a bit faster than _tep_is_bigendian()_, as it -returns cached endianness of the local machine instead of checking it each time. - -The _tep_set_local_bigendian()_ function sets the endianness of the local -machine in the _tep_ handler. The _tep_ argument is trace event parser context. -The _endian_ argument is the endianness: -[verse] --- - _TEP_LITTLE_ENDIAN_ - the machine is little endian, - _TEP_BIG_ENDIAN_ - the machine is big endian. --- - -RETURN VALUE ------------- -The _tep_is_bigendian()_ function returns non zero if the endianness of the -machine, executing the code, is big endian and zero otherwise. - -The _tep_is_local_bigendian()_ function returns true, if the endianness of the -local machine, saved in the _tep_ handler, is big endian, or false otherwise. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... - if (tep_is_bigendian()) - tep_set_local_bigendian(tep, TEP_BIG_ENDIAN); - else - tep_set_local_bigendian(tep, TEP_LITTLE_ENDIAN); -... - if (tep_is_local_bigendian(tep)) - printf("This machine you are running on is bigendian\n"); - else - printf("This machine you are running on is little endian\n"); - --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-long_size.txt deleted +0
-78@@ -1,78 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_long_size, tep_set_long_size - Get / set the size of a long integer on -the machine, where the trace is generated, in bytes - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_get_long_size*(strucqt tep_handle pass:[*]_tep_); -void *tep_set_long_size*(struct tep_handle pass:[*]_tep_, int _long_size_); --- - -DESCRIPTION ------------ -The _tep_get_long_size()_ function returns the size of a long integer on the machine, -where the trace is generated. The _tep_ argument is trace event parser context. - -The _tep_set_long_size()_ function sets the size of a long integer on the machine, -where the trace is generated. The _tep_ argument is trace event parser context. -The _long_size_ is the size of a long integer, in bytes. - -RETURN VALUE ------------- -The _tep_get_long_size()_ function returns the size of a long integer on the machine, -where the trace is generated, in bytes. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -tep_set_long_size(tep, 4); -... -int long_size = tep_get_long_size(tep); -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-page_size.txt deleted +0
-82@@ -1,82 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_get_page_size, tep_set_page_size - Get / set the size of a memory page on -the machine, where the trace is generated - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); -void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); --- - -DESCRIPTION ------------ -The _tep_get_page_size()_ function returns the size of a memory page on -the machine, where the trace is generated. The _tep_ argument is trace -event parser context. - -The _tep_set_page_size()_ function stores in the _tep_ context the size of a -memory page on the machine, where the trace is generated. -The _tep_ argument is trace event parser context. -The _page_size_ argument is the size of a memory page, in bytes. - -RETURN VALUE ------------- -The _tep_get_page_size()_ function returns size of the memory page, in bytes. - -EXAMPLE -------- -[source,c] --- -#include <unistd.h> -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... - int page_size = getpagesize(); - - tep_set_page_size(tep, page_size); - - printf("The page size for this machine is %d\n", tep_get_page_size(tep)); - --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-parse_event.txt deleted +0
-90@@ -1,90 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_parse_event, tep_parse_format - Parse the event format information - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -enum tep_errno *tep_parse_event*(struct tep_handle pass:[*]_tep_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); -enum tep_errno *tep_parse_format*(struct tep_handle pass:[*]_tep_, struct tep_event pass:[*]pass:[*]_eventp_, const char pass:[*]_buf_, unsigned long _size_, const char pass:[*]_sys_); --- - -DESCRIPTION ------------ -The _tep_parse_event()_ function parses the event format and creates an event -structure to quickly parse raw data for a given event. The _tep_ argument is -the trace event parser context. The created event structure is stored in the -_tep_ context. The _buf_ argument is a buffer with _size_, where the event -format data is. The event format data can be taken from -tracefs/events/.../.../format files. The _sys_ argument is the system of -the event. - -The _tep_parse_format()_ function does the same as _tep_parse_event()_. The only -difference is in the extra _eventp_ argument, where the newly created event -structure is returned. - -RETURN VALUE ------------- -Both _tep_parse_event()_ and _tep_parse_format()_ functions return 0 on success, -or TEP_ERRNO__... in case of an error. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -char *buf; -int size; -struct tep_event *event = NULL; -buf = read_file("/sys/kernel/tracing/events/ftrace/print/format", &size); -if (tep_parse_event(tep, buf, size, "ftrace") != 0) { - /* Failed to parse the ftrace print format */ -} - -if (tep_parse_format(tep, &event, buf, size, "ftrace") != 0) { - /* Failed to parse the ftrace print format */ -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-parse_head.txt deleted +0
-82@@ -1,82 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_parse_header_page - Parses the data stored in the header page. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -int *tep_parse_header_page*(struct tep_handle pass:[*]_tep_, char pass:[*]_buf_, unsigned long _size_, int _long_size_); --- - -DESCRIPTION ------------ -The _tep_parse_header_page()_ function parses the header page data from _buf_, -and initializes the _tep_, trace event parser context, with it. The buffer -_buf_ is with _size_, and is supposed to be copied from -tracefs/events/header_page. - -Some old kernels do not have header page info, in this case the -_tep_parse_header_page()_ function can be called with _size_ equal to 0. The -_tep_ context is initialized with default values. The _long_size_ can be used in -this use case, to set the size of a long integer to be used. - -RETURN VALUE ------------- -The _tep_parse_header_page()_ function returns 0 in case of success, or -1 -in case of an error. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -char *buf; -int size; -buf = read_file("/sys/kernel/tracing/events/header_page", &size); -if (tep_parse_header_page(tep, buf, size, sizeof(unsigned long)) != 0) { - /* Failed to parse the header page */ -} -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-plugins.txt deleted +0
-122@@ -1,122 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_load_plugins, tep_unload_plugins, tep_load_plugins_hook - Load / unload traceevent plugins. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_); -void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_); -void *tep_load_plugins_hook*(struct tep_handle pass:[*]_tep_, const char pass:[*]_suffix_, - void (pass:[*]_load_plugin_)(struct tep_handle pass:[*]tep, - const char pass:[*]path, - const char pass:[*]name, - void pass:[*]data), - void pass:[*]_data_); --- - -DESCRIPTION ------------ -The _tep_load_plugins()_ function loads all plugins, located in the plugin -directories. The _tep_ argument is trace event parser context. -The plugin directories are : -[verse] --- - - Directories, specified in _tep_->plugins_dir with priority TEP_PLUGIN_FIRST - - System's plugin directory, defined at the library compile time. It - depends on the library installation prefix and usually is - _(install_preffix)/lib/traceevent/plugins_ - - Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_ - - User's plugin directory, located at _~/.local/lib/traceevent/plugins_ - - Directories, specified in _tep_->plugins_dir with priority TEP_PLUGIN_LAST --- -Loading of plugins can be controlled by the _tep_flags_, using the -_tep_set_flag()_ API: -[verse] --- - _TEP_DISABLE_SYS_PLUGINS_ - do not load plugins, located in - the system's plugin directory. - _TEP_DISABLE_PLUGINS_ - do not load any plugins. --- -The _tep_set_flag()_ API needs to be called before _tep_load_plugins()_, if -loading of all plugins is not the desired case. - -The _tep_unload_plugins()_ function unloads the plugins, previously loaded by -_tep_load_plugins()_. The _tep_ argument is trace event parser context. The -_plugin_list_ is the list of loaded plugins, returned by -the _tep_load_plugins()_ function. - -The _tep_load_plugins_hook_ function walks through all directories with plugins -and calls user specified _load_plugin()_ hook for each plugin file. Only files -with given _suffix_ are considered to be plugins. The _data_ is a user specified -context, passed to _load_plugin()_. Directories and the walk order are the same -as in _tep_load_plugins()_ API. - -RETURN VALUE ------------- -The _tep_load_plugins()_ function returns a list of successfully loaded plugins, -or NULL in case no plugins are loaded. - -EXAMPLE -------- -[source,c] --- -#include <event-parse.h> -... -struct tep_handle *tep = tep_alloc(); -... -struct tep_plugin_list *plugins = tep_load_plugins(tep); -if (plugins == NULL) { - /* no plugins are loaded */ -} -... -tep_unload_plugins(plugins, tep); -... -void print_plugin(struct tep_handle *tep, const char *path, - const char *name, void *data) -{ - pritnf("Found libtraceevent plugin %s/%s\n", path, name); -} -... -tep_load_plugins_hook(tep, ".so", print_plugin, NULL); -... --- - -FILES ------ -[verse] --- -*event-parse.h* - Header file to include in order to have access to the library APIs. -*-ltraceevent* - Linker switch to add when building a program that uses the library. --- - -SEE ALSO --------- -_libtraceevent(3)_, _trace-cmd(1)_, _tep_set_flag(3)_ - -AUTHOR ------- -[verse] --- -*Steven Rostedt* <[email protected]>, author of *libtraceevent*. -*Tzvetomir Stoyanov* <[email protected]>, author of this man page. --- -REPORTING BUGS --------------- -Report bugs to <[email protected]> - -LICENSE -------- -libtraceevent is Free Software licensed under the GNU LGPL 2.1 - -RESOURCES ---------- -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gittools/lib/traceevent/Documentation/libtraceevent-record_parse.txt deleted +0
-137@@ -1,137 +0,0 @@ -libtraceevent(3) -================ - -NAME ----- -tep_data_type, tep_data_pid,tep_data_preempt_count, tep_data_flags - -Extract common fields from a record. - -SYNOPSIS --------- -[verse] --- -*#include <event-parse.h>* - -enum *trace_flag_type* {Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt deleted +0
-156Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt deleted +0
-155Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt deleted +0
-104Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent-strerror.txt deleted +0
-85Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent-tseq.txt deleted +0
-158Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/libtraceevent.txt deleted +0
-192Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-1.72.xsl deleted +0
-14Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-base.xsl deleted +0
-35Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-bold-literal.xsl deleted +0
-17Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-normal.xsl deleted +0
-13Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl deleted +0
-21Lines of this file are not shown. View the raw message.
tools/lib/traceevent/Makefile deleted +0
-300Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-parse-api.c deleted +0
-333Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-parse-local.h deleted +0
-123Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-parse.c deleted +0
-7624Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-parse.h deleted +0
-750Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-plugin.c deleted +0
-711Lines of this file are not shown. View the raw message.
tools/lib/traceevent/event-utils.h deleted +0
-67Lines of this file are not shown. View the raw message.
tools/lib/traceevent/kbuffer-parse.c deleted +0
-809Lines of this file are not shown. View the raw message.
tools/lib/traceevent/kbuffer.h deleted +0
-68Lines of this file are not shown. View the raw message.
tools/lib/traceevent/libtraceevent.pc.template deleted +0
-10Lines of this file are not shown. View the raw message.
tools/lib/traceevent/parse-filter.c deleted +0
-2281Lines of this file are not shown. View the raw message.
tools/lib/traceevent/parse-utils.c deleted +0
-71Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/Build deleted +0
-12Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/Makefile deleted +0
-225Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_cfg80211.c deleted +0
-43Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_function.c deleted +0
-282Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_futex.c deleted +0
-123Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_hrtimer.c deleted +0
-74Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_jbd2.c deleted +0
-61Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_kmem.c deleted +0
-80Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_kvm.c deleted +0
-527Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_mac80211.c deleted +0
-88Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_sched_switch.c deleted +0
-146Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_scsi.c deleted +0
-434Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_tlb.c deleted +0
-66Lines of this file are not shown. View the raw message.
tools/lib/traceevent/plugins/plugin_xen.c deleted +0
-138Lines of this file are not shown. View the raw message.
tools/lib/traceevent/tep_strerror.c deleted +0
-53Lines of this file are not shown. View the raw message.
tools/lib/traceevent/trace-seq.c deleted +0
-249Lines of this file are not shown. View the raw message.
tools/lib/traceevent/trace-seq.h deleted +0
-55Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Signature · 1 line
- Arnaldo
Part of the diff is not shown here. View the raw message.
Arnaldo Carvalho de Melo
maintainerRe: [PATCH v2 4/4] tools lib traceevent: Remove libtraceevent
Em Mon, Dec 12, 2022 at 04:52:47PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 8 lines
Em Tue, Nov 29, 2022 at 10:29:35PM -0800, Ian Rogers escreveu:
Quoted 3 lines
libtraceevent is now out-of-date and it is better to depend on the system version. Remove this code that is no longer depended upon by any builds.
Thanks, applied and Added Steven's Acked-by.
Had to add this to keep 'make perf-tar-src-pkg' working:
tools/perf/MANIFEST +0 -1
@@ -3,7 +3,6 @@ tools/arch tools/scripts tools/build tools/include -tools/lib/traceevent tools/lib/api tools/lib/bpf tools/lib/subcmd
Arnaldo Carvalho de Melo
maintainerEm Tue, Nov 29, 2022 at 10:29:31PM -0800, Ian Rogers escreveu:
Quoted 10 lines
Detect whether libtraceevent is installed and if so build against it. If not installed, warn and build a subset of perf that works without libtraceevent. With nothing using the now out-of-date
tools/lib/traceeventremove it.Discussed on LKML here:
https://lore.kernel.org/lkml/CAP-5=fWxAjEia-Qbm0RVzKOxyiod8rUOBieqaGK=DtQboDe3Qw@mail.gmail.com/Builds upon:
https://lore.kernel.org/lkml/[email protected]/
So the above isn't applying:
⬢[acme@toolbox perf]$ b4 am -P1-4 -ctsl --cc-trailers [email protected] Grabbing thread from lore.kernel.org/all/20221116224631.207631-1-irogers%40google.com/t.mbox.gz Checking for newer revisions on https://lore.kernel.org/all/
Analyzing 5 messages in the thread
Checking attestation on all messages, may take a moment...
---
✓ [PATCH] perf build: Fix LIBTRACEEVENT_DYNAMIC
---
✓ Signed: DKIM/google.com
---
Total patches: 1 (cherrypicked: 1-4)
---
Base: not specified
git am ./20221116_irogers_perf_build_fix_libtraceevent_dynamic.mbx
⬢[acme@toolbox perf]$ git am ./20221116_irogers_perf_build_fix_libtraceevent_dynamic.mbx
Applying: perf build: Fix LIBTRACEEVENT_DYNAMIC
error: patch failed: tools/perf/Makefile.perf:242
error: tools/perf/Makefile.perf: patch does not apply
error: patch failed: tools/perf/util/setup.py:77
error: tools/perf/util/setup.py: patch does not apply
Patch failed at 0001 perf build: Fix LIBTRACEEVENT_DYNAMIC
hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". ⬢[acme@toolbox perf]$ git am --abort
⬢[acme@toolbox perf]$
Quoted 207 lines
Based on discussion of the v1 patch set:
https://lore.kernel.org/lkml/[email protected]/
v2 conditionally compiles a subset of perf that doesn't require libtraceevent to avoid having to have libtraceevent installed on a system.The changes build upon the fix in:
https://lore.kernel.org/lkml/[email protected]/Ian Rogers (4):
perf util: Make header guard consistent with tool perf util: Addhost_is_bigendiantoutil.hperf build: Use libtraceevent from the system tools lib traceevent: Remove libtraceeventtools/lib/traceevent/.gitignore | 4 - tools/lib/traceevent/Build | 8 - tools/lib/traceevent/Documentation/Makefile | 207 - .../traceevent/Documentation/asciidoc.conf | 120 - .../Documentation/libtraceevent-commands.txt | 153 - .../Documentation/libtraceevent-cpus.txt | 77 - .../libtraceevent-endian_read.txt | 78 - .../libtraceevent-event_find.txt | 103 - .../Documentation/libtraceevent-event_get.txt | 99 - .../libtraceevent-event_list.txt | 122 - .../libtraceevent-event_print.txt | 130 - .../libtraceevent-field_find.txt | 118 - .../libtraceevent-field_get_val.txt | 122 - .../libtraceevent-field_print.txt | 126 - .../libtraceevent-field_read.txt | 81 - .../Documentation/libtraceevent-fields.txt | 105 - .../libtraceevent-file_endian.txt | 91 - .../Documentation/libtraceevent-filter.txt | 209 - .../Documentation/libtraceevent-func_apis.txt | 183 - .../Documentation/libtraceevent-func_find.txt | 88 - .../Documentation/libtraceevent-handle.txt | 101 - .../libtraceevent-header_page.txt | 102 - .../libtraceevent-host_endian.txt | 104 - .../Documentation/libtraceevent-long_size.txt | 78 - .../Documentation/libtraceevent-page_size.txt | 82 - .../libtraceevent-parse_event.txt | 90 - .../libtraceevent-parse_head.txt | 82 - .../Documentation/libtraceevent-plugins.txt | 122 - .../libtraceevent-record_parse.txt | 137 - .../libtraceevent-reg_event_handler.txt | 156 - .../libtraceevent-reg_print_func.txt | 155 - .../Documentation/libtraceevent-set_flag.txt | 104 - .../Documentation/libtraceevent-strerror.txt | 85 - .../Documentation/libtraceevent-tseq.txt | 158 - .../Documentation/libtraceevent.txt | 192 - .../traceevent/Documentation/manpage-1.72.xsl | 14 - .../traceevent/Documentation/manpage-base.xsl | 35 - .../Documentation/manpage-bold-literal.xsl | 17 - .../Documentation/manpage-normal.xsl | 13 - .../Documentation/manpage-suppress-sp.xsl | 21 - tools/lib/traceevent/Makefile | 300 - tools/lib/traceevent/event-parse-api.c | 333 - tools/lib/traceevent/event-parse-local.h | 123 - tools/lib/traceevent/event-parse.c | 7624 ----------------- tools/lib/traceevent/event-parse.h | 750 -- tools/lib/traceevent/event-plugin.c | 711 -- tools/lib/traceevent/event-utils.h | 67 - tools/lib/traceevent/kbuffer-parse.c | 809 -- tools/lib/traceevent/kbuffer.h | 68 - .../lib/traceevent/libtraceevent.pc.template | 10 - tools/lib/traceevent/parse-filter.c | 2281 ----- tools/lib/traceevent/parse-utils.c | 71 - tools/lib/traceevent/plugins/Build | 12 - tools/lib/traceevent/plugins/Makefile | 225 - .../lib/traceevent/plugins/plugin_cfg80211.c | 43 - .../lib/traceevent/plugins/plugin_function.c | 282 - tools/lib/traceevent/plugins/plugin_futex.c | 123 - tools/lib/traceevent/plugins/plugin_hrtimer.c | 74 - tools/lib/traceevent/plugins/plugin_jbd2.c | 61 - tools/lib/traceevent/plugins/plugin_kmem.c | 80 - tools/lib/traceevent/plugins/plugin_kvm.c | 527 -- .../lib/traceevent/plugins/plugin_mac80211.c | 88 - .../traceevent/plugins/plugin_sched_switch.c | 146 - tools/lib/traceevent/plugins/plugin_scsi.c | 434 - tools/lib/traceevent/plugins/plugin_tlb.c | 66 - tools/lib/traceevent/plugins/plugin_xen.c | 138 - tools/lib/traceevent/tep_strerror.c | 53 - tools/lib/traceevent/trace-seq.c | 249 - tools/lib/traceevent/trace-seq.h | 55 - tools/perf/Build | 11 +- tools/perf/Makefile.config | 37 +- tools/perf/Makefile.perf | 99 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/arch/x86/util/intel-pt.c | 4 + tools/perf/builtin-annotate.c | 2 + tools/perf/builtin-inject.c | 8 + tools/perf/builtin-kmem.c | 1 + tools/perf/builtin-kvm.c | 12 +- tools/perf/builtin-kwork.c | 1 + tools/perf/builtin-record.c | 2 + tools/perf/builtin-report.c | 9 +- tools/perf/builtin-script.c | 19 +- tools/perf/builtin-timechart.c | 1 + tools/perf/builtin-trace.c | 5 +- tools/perf/builtin-version.c | 1 + tools/perf/perf.c | 24 +- .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/tests/Build | 12 +- tools/perf/tests/builtin-test.c | 6 + tools/perf/tests/code-reading.c | 4 +- tools/perf/tests/parse-events.c | 20 + tools/perf/tests/sample-parsing.c | 4 +- tools/perf/util/Build | 10 +- tools/perf/util/data-convert-bt.c | 5 +- tools/perf/util/data-convert-json.c | 9 +- tools/perf/util/evlist.c | 6 +- tools/perf/util/evlist.h | 4 + tools/perf/util/evsel.c | 16 +- tools/perf/util/evsel.h | 12 +- tools/perf/util/evsel_fprintf.c | 7 +- tools/perf/util/header.c | 19 + tools/perf/util/header.h | 2 + tools/perf/util/intel-pt.c | 7 +- tools/perf/util/parse-events.c | 15 + tools/perf/util/parse-events.h | 1 - tools/perf/util/python.c | 4 + tools/perf/util/scripting-engines/Build | 6 +- .../scripting-engines/trace-event-python.c | 1 + tools/perf/util/session.c | 2 + tools/perf/util/session.h | 2 + tools/perf/util/sort.c | 60 +- tools/perf/util/synthetic-events.c | 6 + tools/perf/util/trace-event-info.c | 14 +- tools/perf/util/trace-event-parse.c | 2 + tools/perf/util/trace-event-read.c | 4 +- tools/perf/util/trace-event-scripting.c | 1 + tools/perf/util/trace-event.c | 1 - tools/perf/util/trace-event.h | 13 +- tools/perf/util/util.h | 25 +- 119 files changed, 344 insertions(+), 20071 deletions(-) delete mode 100644 tools/lib/traceevent/.gitignore delete mode 100644 tools/lib/traceevent/Build delete mode 100644 tools/lib/traceevent/Documentation/Makefile delete mode 100644 tools/lib/traceevent/Documentation/asciidoc.conf delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-commands.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-cpus.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-endian_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_get.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_list.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-event_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_get_val.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_print.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-field_read.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-fields.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-file_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-filter.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-func_find.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-handle.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-header_page.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-host_endian.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-long_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-page_size.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_event.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-parse_head.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-plugins.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-record_parse.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_event_handler.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-reg_print_func.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-strerror.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent-tseq.txt delete mode 100644 tools/lib/traceevent/Documentation/libtraceevent.txt delete mode 100644 tools/lib/traceevent/Documentation/manpage-1.72.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-base.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-bold-literal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-normal.xsl delete mode 100644 tools/lib/traceevent/Documentation/manpage-suppress-sp.xsl delete mode 100644 tools/lib/traceevent/Makefile delete mode 100644 tools/lib/traceevent/event-parse-api.c delete mode 100644 tools/lib/traceevent/event-parse-local.h delete mode 100644 tools/lib/traceevent/event-parse.c delete mode 100644 tools/lib/traceevent/event-parse.h delete mode 100644 tools/lib/traceevent/event-plugin.c delete mode 100644 tools/lib/traceevent/event-utils.h delete mode 100644 tools/lib/traceevent/kbuffer-parse.c delete mode 100644 tools/lib/traceevent/kbuffer.h delete mode 100644 tools/lib/traceevent/libtraceevent.pc.template delete mode 100644 tools/lib/traceevent/parse-filter.c delete mode 100644 tools/lib/traceevent/parse-utils.c delete mode 100644 tools/lib/traceevent/plugins/Build delete mode 100644 tools/lib/traceevent/plugins/Makefile delete mode 100644 tools/lib/traceevent/plugins/plugin_cfg80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_function.c delete mode 100644 tools/lib/traceevent/plugins/plugin_futex.c delete mode 100644 tools/lib/traceevent/plugins/plugin_hrtimer.c delete mode 100644 tools/lib/traceevent/plugins/plugin_jbd2.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kmem.c delete mode 100644 tools/lib/traceevent/plugins/plugin_kvm.c delete mode 100644 tools/lib/traceevent/plugins/plugin_mac80211.c delete mode 100644 tools/lib/traceevent/plugins/plugin_sched_switch.c delete mode 100644 tools/lib/traceevent/plugins/plugin_scsi.c delete mode 100644 tools/lib/traceevent/plugins/plugin_tlb.c delete mode 100644 tools/lib/traceevent/plugins/plugin_xen.c delete mode 100644 tools/lib/traceevent/tep_strerror.c delete mode 100644 tools/lib/traceevent/trace-seq.c delete mode 100644 tools/lib/traceevent/trace-seq.hSignature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Signature · 1 line
- Arnaldo